Replacing "/[^>][\n\r]+/" with "<br />\n"
ribchr00_at_stud.unibas.ch
Date: 02/28/05
- Next message: Derek Fountain: "Re: Replacing "/[^>][\n\r]+/" with "<br />\n""
- Previous message: doug: "WebDav SEARCH question"
- Next in thread: Derek Fountain: "Re: Replacing "/[^>][\n\r]+/" with "<br />\n""
- Reply: Derek Fountain: "Re: Replacing "/[^>][\n\r]+/" with "<br />\n""
- Reply: Chung Leong: "Re: Replacing "/[^>][\n\r]+/" with "<br />\n""
- Reply: zeldorblat_at_gmail.com: "Re: Replacing "/[^>][\n\r]+/" with "<br />\n""
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 28 Feb 2005 00:49:55 -0800
Hi all,
I would like to replace line breaks such '[\n\r]+' with '<br />'. Easy
task. Problems start when I try to only replace lines that do not end
with HTML tags.
I tried preg_replace("/[^>][\n\r]+/", "<br />\n") but this does not
seem to work.
An example to better understand what I would like to achieve:
first line
<title>Title</title>
third line
should give:
first line<br />
<title>Title</title>
third line<br />
Any help would be grateful appreciated. Thanks and have a nice day,
christian
- Next message: Derek Fountain: "Re: Replacing "/[^>][\n\r]+/" with "<br />\n""
- Previous message: doug: "WebDav SEARCH question"
- Next in thread: Derek Fountain: "Re: Replacing "/[^>][\n\r]+/" with "<br />\n""
- Reply: Derek Fountain: "Re: Replacing "/[^>][\n\r]+/" with "<br />\n""
- Reply: Chung Leong: "Re: Replacing "/[^>][\n\r]+/" with "<br />\n""
- Reply: zeldorblat_at_gmail.com: "Re: Replacing "/[^>][\n\r]+/" with "<br />\n""
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]