Hello,
I cannot make use of regex to replace. For instance, I got source code from a developper who writes section bodies like:
header { <body> }
and wanted to replace that pattern by:
header { <body> }
So my regex was: search: "\n\t*{" replace: " {"
But I always get 'No matches found for "\n\t*{"'. (Also tried "\n\t+{")
denis
On Fri, 5 Mar 2010 12:36:51 +0100 spir denis.spir@gmail.com wrote:
Hello,
I cannot make use of regex to replace. For instance, I got source code from a developper who writes section bodies like:
header { <body> }
and wanted to replace that pattern by:
header { <body> }
So my regex was: search: "\n\t*{" replace: " {"
But I always get 'No matches found for "\n\t*{"'. (Also tried "\n\t+{")
OK, solved. Seems the regex patterns cannot hold '\n'. So, i do it in 2 passes: * "\t*{" --> " {" (with regex) * "\n {" --> " {" (without)
Denis
Hi Denis
OK, solved. Seems the regex patterns cannot hold '\n'. So, i do it in 2
passes:
- "\t*{" --> " {" (with regex)
- "\n {" --> " {" (without)
There's a 'Use escape sequences' checkbox in the search - maybe you need to tick that? I've found before that I need both that and regex ticked to do the sort of search you're doing.
Cheers
On Fri, 5 Mar 2010 12:02:27 +0000 Ronan Chilvers ronan@d3r.com wrote:
OK, solved. Seems the regex patterns cannot hold '\n'. So, i do it in 2
passes:
- "\t*{" --> " {" (with regex)
- "\n {" --> " {" (without)
There's a 'Use escape sequences' checkbox in the search - maybe you need to tick that? I've found before that I need both that and regex ticked to do the sort of search you're doing.
I know what you mean, but currently it's just not possible to do multiline regex matching. I am working on it though.
Regards, Nick