Bug #66708 [Nab]: preg_match reports missing right-perand incorrectly

From: Date: Thu, 13 Feb 2014 19:14:19 +0000
Subject: Bug #66708 [Nab]: preg_match reports missing right-perand incorrectly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-184294@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66708&edit=1 ID: 66708 Updated by: requinix@php.net Reported by: jbeecher at oneendlessloop dot com Summary: preg_match reports missing right-perand incorrectly Status: Not a bug Type: Bug Package: Regexps related Operating System: Linux PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Looks to have been in place since at least 4.3.0. http://3v4l.org/S6sgk Previous Comments: ------------------------------------------------------------------------ [2014-02-13 18:58:57] jbeecher at oneendlessloop dot com *thank you*.... is this for all versions of PHP, or is this a 5.5 or later sort of thing? ------------------------------------------------------------------------ [2014-02-13 18:55:05] requinix@php.net http://www.php.net/manual/en/regexp.reference.escape.php ------------------------------------------------------------------------ [2014-02-13 18:37:24] jbeecher at oneendlessloop dot com To add... normally if I'm going to specify any control character, I would use \x{5B} where '5B' is whatever the hex code is I wish to check for. Please confirm that '\c' is also for control characters, reference a source-document, and provide an example. ------------------------------------------------------------------------ [2014-02-13 18:33:40] jbeecher at oneendlessloop dot com Okay. Per the PCRE docs I'm aware of the backslash character is used to escape the next character to its literal form. I just wanted to make sure it saw it as a 'c'. I have never seen PCRE consider backslash-c as a control character... If that's so, it's undocumented. ------------------------------------------------------------------------ [2014-02-13 17:27:48] requinix@php.net \c is supposed to be \cX, where X is a character. Together they form the escape sequence for a control character. You've given it \c). You'd need another ) after that - except I don't think you mean to use \c) in the first place. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=66708 -- Edit this bug report at https://bugs.php.net/bug.php?id=66708&edit=1

« previous php.bugs (#184294) next »