Hi All,
I don't actually think regexp is fault. But if anyone could explain this or
give me some example code that will extract the attributes and data between
a fieldset tag pair I would be appreciated.
Henry
Henry Grech-Cini [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi All,
Henry Grech-Cini schrieb:
...
$regexp=/fieldset([^]*)[^(\/fieldset)]*/i;
...
$result=extractFieldsets('testfieldset attribute=hellocontent of
hello/fieldsetemblah/emfieldset
attribute=goodbyegoodbye/fieldset');
...
And it produced;
(0)=
(0)=[fieldset attribute=hellocon]
(1)=[fieldset
Thanks Sven,
You are quite right with your some probs comment.
Do you know what the the switch is that catches only the least result?
I now get
(0)=
(0)=[fieldset attribute=hellolegendhello legend/legendcontent of
hello/fieldsetemblah/emfieldset
attribute=goodbyegoodbye/fieldset]
(1)=
(0)=[
I came accross this link
a href=
http://www.alpha-geek.com/2003/12/31/do_not_do_not_parse_html_with_regexs.html
http://www.alpha-geek.com/2003/12/31/do_not_do_not_parse_html_with_regexs.html /a
Do we all agree or should I keep trying?
Henry
--
PHP General Mailing List (http://www.php.net/)
Henry Grech-Cini schrieb:
Thanks Sven,
You are quite right with your some probs comment.
hi,
think i found it. try this:
?php
$rx = '/fieldset.*(.*)\/fieldset/iU';
?
the '/U' stands for 'ungreedy'. also note the change in the attribs-regex.
hth SVEN
--
PHP General Mailing List
Henry Grech-Cini schrieb:
I came accross this link
a href=
http://www.alpha-geek.com/2003/12/31/do_not_do_not_parse_html_with_regexs.html
http://www.alpha-geek.com/2003/12/31/do_not_do_not_parse_html_with_regexs.html /a
Do we all agree or should I keep trying?
Henry
hi henry,
this could be an
On Tue, 2004-02-24 at 10:49, Henry Grech-Cini wrote:
http://www.alpha-geek.com/2003/12/31/do_not_do_not_parse_html_with_regexs.html
Do we all agree or should I keep trying?
The important thing to keep in mind here is to use the right tool for
the job. If you are parsing an HTML document
7 matches
Mail list logo