note 125720 added to regexp.reference.back-references
| From: | emosewaj at gmx dot de | Date: | Mon, 25 Jan 2021 10:05:34 +0000 |
| Subject: | note 125720 added to regexp.reference.back-references | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-216227@lists.php.net to get a copy of this message | ||
Mind that back references only work in single-quoted strings. In double quoted strings, they will be
parsed as the octal notation of a character.
<?php
preg_match("/^(a)(?!\1)/", "aa");
// true, that's not what we want!
// Notice the only difference being the single quotes.
preg_match('/^(a)(?!\1)/', "aa");
// false
?>
----
Server IP: 45.112.84.4
Probable Submitter: 45.91.159.166 (proxied: 80.151.39.220)
----
Manual Page -- http://php.net/manual/en/regexp.reference.back-references.php
Edit -- https://master.php.net/note/edit/125720
Del: integrated -- https://master.php.net/note/delete/125720/integrated
Del: useless -- https://master.php.net/note/delete/125720/useless
Del: bad code -- https://master.php.net/note/delete/125720/bad+code
Del: spam -- https://master.php.net/note/delete/125720/spam
Del: non-english -- https://master.php.net/note/delete/125720/non-english
Del: in docs -- https://master.php.net/note/delete/125720/in+docs
Del: other reasons-- https://master.php.net/note/delete/125720
Reject -- https://master.php.net/note/reject/125720
Search -- https://master.php.net/manage/user-notes.php