12-06-2007, 02:13 AM
|
#2 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
They're called named capturing groups (as opposed to just capturing groups or non-capturing groups). There are a few alternative syntaxes in RegEx-land for doing this, but (?P<name>...) is all that PHP can use (PCRE).
More information is available on the ever useful regular-expressions.info site or in the PHP Manual. As far as I'm aware, the numeric key cannot be omitted from the resulting array of matches. That said it's a trivial matter to parse that array to remove items with a numeric key if you really wanted to. 
|
|
|
|