[Geany] use of regex -- solved

spir denis.spir at xxxxx
Fri Mar 5 11:53:19 UTC 2010


On Fri, 5 Mar 2010 12:36:51 +0100
spir <denis.spir at 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
-- 
________________________________

la vita e estrany

spir.wikidot.com




More information about the Users mailing list