Doc #62756 [Opn]: preg documentation should mention '=' should not be first in character class

From: Date: Mon, 06 Aug 2012 12:32:59 +0000
Subject: Doc #62756 [Opn]: preg documentation should mention '=' should not be first in character class
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-8701@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=62756&edit=1 ID: 62756 Updated by: salathe@php.net Reported by: marco at greenlightsolutions dot nl Summary: preg documentation should mention '=' should not be first in character class Status: Open Type: Documentation Problem Package: Documentation problem PHP Version: Irrelevant Block user comment: N Private report: N New Comment: [=~] should not be causing the warning, however [=abc=] and [.abc.] will. Previous Comments: ------------------------------------------------------------------------ [2012-08-06 11:32:58] marco at greenlightsolutions dot nl Description: ------------ --- From manual page: http://www.php.net/regexp.reference.character-classes --- Briefly: The documentation for character classes should state that '=' after '[' is a reserved construct and should be avoided. In detail: If you put a '=' first in a character class in a perl regular expression, such as '[=~]', in certain versions of PHP (including PHP 5.3.8) this will fail to compile, with a warning "Compilation failed: POSIX collating elements are not supported". Rewriting it as '[~=]' prevents the error message. This is because the combination "[=" is seen as indicative of a "POSIX collating element", a reserved, not-yet-implemented syntactical construct. A full description of the cause was written up by Tom Christiansen at http://stackoverflow.com/questions/7173787/compilation-failed-posix-collating-elements-are-not-supported#7175589. The 'preg character classes' documentation page should include the information that '=' in the beginning of a character class is treated special, but it doesn't mention the '=' sign at all. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=62756&edit=1

« previous php.doc.bugs (#8701) next »