Saturday, January 25, 2014

Replacing a string which is in a line and not in the beginning?

Hi,

I have a file that looks like this:
- This is a te- st
- foo bar

And I want to replace all occurrences of "- " when they are not at the
beginning of the line. So the above mentioned file should look like:
- This is a test
- foo bar

I tried to find something and it seems that in "normal" regex I would
have to do something like ^.+(- .) or ^.?<pattern> but those don't work.
What do I have to do to get the replacements I want?

Thanks,

Niels

No comments: