Using newlines in the expression does not make sense as
mod_substitute (similar to sed) does apply the regular expression
line by line. You cannot process multiline regexs with mod_substitute.

Regards

Rüdiger 

> -----Ursprüngliche Nachricht-----
> Von: Nick Gearls 
> Gesendet: Donnerstag, 19. März 2009 15:43
> An: [email protected]
> Betreff: mod_substitute & \n
> 
> I found a problem with handling of new lines in mod_substitute.
> Take the following file as example
>       <html>
>       <body>
>       </body>
>       </html>
>       
> 
> 1. If I use "Substitute  s/\n/1/", it works almost correctly:
>       <html>
>       1<body>
>       1</body>
>       1</html>
>       1
> Note that it does not replace the new line, but adds the replacement 
> after it. This is quite weird.
> 
> 2. If I use "Substitute s/<body>\n/<body>2/" or
>     "Substitute s/\n<body>/<body>2/", the file is unchanged
> 
> 
> Could somebody explain how newlines are handled ?
> Can we use them inside a pattern ?
> 
> Thanks,
> 
> 
> Nick
> 
> 

Reply via email to