PCRE vs. POSIX-extended for regular expressions
| From: | SLanger at spirit21 dot de | Date: | Thu, 29 Jan 2004 02:26:04 +0000 |
| Subject: | PCRE vs. POSIX-extended for regular expressions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-176155@lists.php.net to get a copy of this message | ||
Hello
The reaseon why PCRE is faster is because the POSIX standard demands to
return the longest matching string which means POSIX checks all possible
matches while PCRE simply returns the first valid match. In cases where
there is no match both have to check all matches.
The other thing is, as mentioned before PCRE is a lot more powerfull than
POSIX. It contains stuff like look ahead, look behind which POSIX doesn't
support.
Regards
Stefan Langer