October 24th, 2011, 02:46 PM
Replace first instance only in every line.
I'm using Emeditor, I would like to use a regex command which does the following. I would like to replace the first instance of an expression on every line. Example
tomatoes are great . they are considered fruits . they're red.
tomatoes are great : they are considered fruits . they're red.
You can see that the first period was replace by a ":", but the second period did not change, as well as the last period. I want to convert only the first period of every line to become a semi-colon. Any help is appreciated.
October 24th, 2011, 03:31 PM
Another way of putting that is to replace the first length of non-periods plus a period with that same first length plus a colon. Use ^ to match the beginning of a line.
Replace ^([^.]+)\. with \1: