httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Gearls <nickgea...@gmail.com>
Subject mod_substitute & \n
Date Thu, 19 Mar 2009 14:43:27 GMT
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


Mime
View raw message