[PHP] filter function vs regular expression

2008-12-20 Thread Alain Roger
Hi, i'm reading a book about PHP and i was wondering why regular expressions are so often used to check format of variables or emails while the function filter exists since version 5.2. What are the plus of regular expression while checking variable format ? thx. -- Alain

Re: [PHP] filter function vs regular expression

2008-12-20 Thread Richard Heyes
i'm reading a book about PHP and i was wondering why regular expressions are so often used to check format of variables or emails while the function filter exists since version 5.2. That's not so long. What are the plus of regular expression while checking variable format ? They' more

Re: [PHP] filter function vs regular expression

2008-12-20 Thread Nathan Nobbe
On Sat, Dec 20, 2008 at 9:06 AM, Richard Heyes rich...@php.net wrote: i'm reading a book about PHP and i was wondering why regular expressions are so often used to check format of variables or emails while the function filter exists since version 5.2. That's not so long. What are the

Re: [PHP] filter function vs regular expression

2008-12-20 Thread Robert Cummings
On Sat, 2008-12-20 at 16:22 +0100, Alain Roger wrote: Hi, i'm reading a book about PHP and i was wondering why regular expressions are so often used to check format of variables or emails while the function filter exists since version 5.2. What are the plus of regular expression while

Re: [PHP] filter function vs regular expression

2008-12-20 Thread Per Jessen
Nathan Nobbe wrote: to elaborate, in general, the filter extension should be faster than corresponding preg_* calls from user space. why? b/c, they essentially are compiled calls to pcre (in many cases) There is no or only the tiniest little difference - AFAICT preg_match and the filter

Re: [PHP] filter function vs regular expression

2008-12-20 Thread Richard Heyes
/* From http://cvs.php.net/co.php/pear/HTML_QuickForm/QuickForm/Rule/Email.php?r=1.4 */ Huh. I was under the impression that it did full verification, as according to RFC (2)822. Not that that's generally necessary, in fact it's mostly just outdated crap, (the technical term I believe). --

Re: [PHP] filter function vs regular expression

2008-12-20 Thread Stan Vassilev | FM
Huh. I was under the impression that it did full verification, as according to RFC (2)822. Not that that's generally necessary, in fact it's mostly just outdated crap, (the technical term I believe). -- Richard Heyes That's the problem with the filter extension. It's a black box and you