Re: regexp appears to be faulty!?

From: Date: Tue, 24 Feb 2004 16:22:11 +0000
Subject: Re: regexp appears to be faulty!?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-178724@lists.php.net to get a copy of this message
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 interesting discussion. i think there can be a solution for every problem. it's only a question of the logic. the main problem in this example are white spaces in every kind (space, tab, newline, carriage return, ...) and there are solutions in regex. a little example: '/( |\t|\n|\r)*/' checks optional white spaces you can also give '\s*' a try (any whitespace char). maybe it also works with '\r\n'? just some thoughts. hth SVEN ps: it surely is possible to ignore everything between '<script></script>', isn't it?

« previous php.general (#178724) next »