note 83951 rejected from function.preg-match by philip
| From: | philip@php.net | Date: | Fri, 20 Jun 2008 03:18:01 +0000 |
| Subject: | note 83951 rejected from function.preg-match by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-140609@lists.php.net to get a copy of this message | ||
Note Submitter: mhuggins57 at yahoo dot com
----
Does anyone know if there's a way to include a decimal/period character in a subpattern? For
example, I'd like to do something like the following:
<?php
preg_match('/(?<User.name>\w+): (?<User.age>\d+)/', $str, $matches);
?>
Unfortunately, I get the following error since I use a decimal:
"Compilation failed: syntax error in subpattern name (missing terminator)"