Re: PCRE sub-expressions matching
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: PCRE sub-expressions matching

From: <jens@aggergren.dk>
Date: Mon Oct 31 2005 - 14:38:33 CET

>Without trying it (never knew you could name them <sheepish grin>) I
>would assume you could use (?:P<host>
Sadly not, because ?: effectively instruct the parser not to save the
subexpression match, so using it with the P option simply causes an
error (or nothing to be mached).

>On the other hand, however, does it really matter? Even if you are
>ooping, just do a quick test to see if the key is numeric
Sure, and i realize that it's probably not something I should worry
about until I sit down and do a real benchmark. Premature optimization
is an antipattern after all.

>Also, the url_parse function does what you are looking for, and will do
>it faster.
Granted, it only an example; Also i wanted slightly different behavior.
Received on Mon Nov 21 02:53:32 2005