note 83951 added to function.preg-match

From: Date: Fri, 20 Jun 2008 02:38:04 +0000
Subject: note 83951 added to function.preg-match
Groups: php.notes 
Request: Send a blank email to php-notes+get-140608@lists.php.net to get a copy of this message
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)" ---- Server IP: 64.71.164.2 Probable Submitter: 69.242.2.216 ---- Manual Page -- http://www.php.net/manual/en/function.preg-match.php Edit -- https://master.php.net/note/edit/83951 Del: integrated -- https://master.php.net/note/delete/83951/integrated Del: useless -- https://master.php.net/note/delete/83951/useless Del: bad code -- https://master.php.net/note/delete/83951/bad+code Del: spam -- https://master.php.net/note/delete/83951/spam Del: non-english -- https://master.php.net/note/delete/83951/non-english Del: in docs -- https://master.php.net/note/delete/83951/in+docs Del: other reasons-- https://master.php.net/note/delete/83951 Reject -- https://master.php.net/note/reject/83951 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#140608) next »