Re: [PHP] regexp appears to be faulty!?

2004-02-25 Thread Henry Grech-Cini
Absolutely brilliant, also I'm using the /s modifier to process newlines as well. Great Thanks to everybody for their help. Jome [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Henry Grech-Cini [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] Thanks for that Mike,

[PHP] regexp appears to be faulty!?

2004-02-24 Thread Henry Grech-Cini
Hi All, function extractFieldsets($subject) { $regexp=/fieldset([^]*)[^(\/fieldset)]*/i; $replacement; $matches=array(); preg_match_all($regexp, $subject, $matches); return ($matches); } $result=extractFieldsets('testfieldset attribute=hellocontent of

RE: [PHP] regexp appears to be faulty!?

2004-02-24 Thread Ford, Mike [LSS]
On 24 February 2004 12:40, Henry Grech-Cini wrote: Hi All, function extractFieldsets($subject) { $regexp=/fieldset([^]*)[^(\/fieldset)]*/i; This: [^(\/fieldset)] will match any *single* character except the ones listed -- i.e. any character that isn't one of: ()/defilst So this:

Re: [PHP] regexp appears to be faulty!?

2004-02-24 Thread Henry Grech-Cini
Thanks for that Mike, I was getting lost. Is there anyway to say Any characters excluding the sequence /fieldset so I could do something like /fieldset([^]*)(.* whilst not \/fieldset)\/fieldset/i Or alternatively is there a switch to say get the smallest sequence Thanks Henry Mike Ford

Re: [PHP] regexp appears to be faulty!?

2004-02-24 Thread Jome
Henry Grech-Cini [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] Thanks for that Mike, I was getting lost. Is there anyway to say Any characters excluding the sequence /fieldset so I could do something like /fieldset([^]*)(.* whilst not \/fieldset)\/fieldset/i Or