[PHP] preg_replace pains

2002-06-27 Thread Richard Davey
Hi all, I've been having a wonderful night trying to solve this one, but I'm going to throw in the towel and see if anyone else can shed some light on it. The scenerio is quite simple, I'm parsing some form input from a user and looking for the following: [details]...[/details] where the

RE: [PHP] preg_replace pains

2002-06-27 Thread John Holmes
Wouldn't you want to use preg_match() before you replace it? www.php.net/preg_match ---John Holmes... -Original Message- From: Richard Davey [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 27, 2002 9:37 PM To: [EMAIL PROTECTED] Subject: [PHP] preg_replace pains Hi all, I've

Re: [PHP] preg_replace pains

2002-06-27 Thread Richard Davey
John Holmes [EMAIL PROTECTED] wrote in message 000a01c21e45$92b64270$b402a8c0@mango">news:000a01c21e45$92b64270$b402a8c0@mango... Wouldn't you want to use preg_match() before you replace it? In this instance, no I don't think so. I've already performed the task I needed with the tags in

Re: [PHP] preg_replace pains

2002-06-27 Thread Analysis Solutions
Hi Richard: On Fri, Jun 28, 2002 at 02:36:59AM +0100, Richard Davey wrote: [details]...[/details] $message = preg_replace('\[details\].*?', , $message); You didn't state what you want to get out of this exercise. To squash the detail tags and everything between them: $msg =

Re: [PHP] preg_replace pains

2002-06-27 Thread Paul Roberts
try $str = preg_replace(|\[details\].*?\[/details\]|si,, $str); drop the i if you want it case sensitive. Paul Richard Davey [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi all, I've been having a wonderful night trying to solve this one, but I'm going