note 40351 added to function.preg-match
| From: | ChristophS at rn2 dot php dot net | Date: | Mon, 01 Mar 2004 00:55:13 +0000 |
| Subject: | note 40351 added to function.preg-match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-66013@lists.php.net to get a copy of this message | ||
A more complex regex that matches all text up to the first, unquoted colon (works with escaped
quotes):
<?php
preg_match(
'((((?<!\\)"([^"]|(\\"))*(?<!\\)")|(\\")|[^:"])*):' ,
$line, $regs)
?>
Example:
Param="Value\":\"Value":XXX
----
Manual Page -- http://www.php.net/manual/en/function.preg-match.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40351
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40351&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40351&report=yes
Search -- http://master.php.net/manage/user-notes.php