Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to automatically globally search through a file in a Windows system and replace certain strings with the found string, plus a carriage return (^r^n, or something like that). Here is what I'm using, but it doesn't work.

s/\d\+\./&^M/g

In other words, I want to open up a new line following every occurrence of the string. Any ideas? Also, ^r^n may be overkill. I just want a windows-style new-line.

share|improve this question
up vote 1 down vote accepted

You want \r

s/\d\+\./&\r/g

I'm unsure what you expect to be matched by \d\+\. - a series of digits followed by a literal period (AKA full stop) or decimal point.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .