Page 1 of 1

unmatched parentheses in regex :-(

Posted: Thu Sep 19, 2002 11:50 am
by Kevin Pfeiffer
Here is my regex: \(.+\n\) to be replaced by: \1\n

And I get: Unmatched '( or {'

I'm not using POSIX and the docs say the brackets need to be escaped, but it's not working. Why??? (Pleeease help me, it's driving me crazy)

-K

Re: unmatched parentheses in regex :-(

Posted: Thu Sep 19, 2002 5:39 pm
by Andreas
it is the \n which causes this.

Use

\(.+\)\n

instead and replace by

\1\n\n