RE: [PHP] preg_replace pain!

From: Date: Thu, 18 Jan 2001 06:07:03 +0000
Subject: RE: [PHP] preg_replace pain!
Groups: php.general 
Request: Send a blank email to php-general+get-35270@lists.php.net to get a copy of this message
maybe : $pattern = "/\[b\]([.\n]*)\[\/b\]/Ui";. have you tried it succesfully? P.S: I am not sure that \n in preg is a newline, you could also try this: $pattern = "/\[b\]([.".chr(10).chr(13)."]*)\[\/b\]/Ui";. one of these ... Cheers, Maxim Maletsky -----Original Message----- From: Nicholas Pappas [mailto:nick@rightstep.org] Sent: Thursday, January 18, 2001 3:41 PM To: php-general@lists.php.net Subject: [PHP] preg_replace pain! I was hoping someone could help me with this regular expression... $pattern = "/\[b\](.*)\[\/b\]/Ui"; $message = preg_replace($pattern, "<B>\\1</B>", $message); The above works for: [b]bold text[/b] But does not work for: [b]bold text w/ newline[/b] Can anyone help me sort this little issue out? Many thanks!! Nick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#35270) next »