#18714 [Opn]: preg_match requires double-escape for \ and /

From: Date: Fri, 02 Aug 2002 21:20:18 +0000
Subject: #18714 [Opn]: preg_match requires double-escape for \ and /
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-15866@lists.php.net to get a copy of this message
ID: 18714 User updated by: dhoherd@actiontec.com Reported By: dhoherd@actiontec.com Status: Open Bug Type: Regexps related Operating System: rh7.3 / win2kpro PHP Version: 4.2.2 New Comment: using preg_match(), and possibly others that i haven't tested, to search for \ or / requires you to double-escape the characters. "/[\\\\\/]/" - works fine and mathches either \ or /. "/[\\\/]/" - doesn't work, gives the error "Warning: Unknown modifier ']'" Previous Comments: ------------------------------------------------------------------------ [2002-08-02 17:19:01] dhoherd@actiontec.com using preg match to search for \ or / requires you to double-escape the characters. "/[\\\\\/]/" - works fine and mathches either \ or /. "/[\\\/]/" - doesn't work, gives the error "Warning: Unknown modifier ']'" ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18714&edit=1

« previous php.bugs (#15866) next »