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

From: Date: Fri, 02 Aug 2002 23:03:04 +0000
Subject: #18714 [Opn->Bgs]: preg_match requires double-escape for \ and /
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-15873@lists.php.net to get a copy of this message
ID: 18714 Updated by: sniper@php.net Reported By: dhoherd@actiontec.com -Status: Open +Status: Bogus Bug Type: Regexps related Operating System: rh7.3 / win2kpro PHP Version: 4.2.2 New Comment: Sorry, but the bug system is not the appropriate forum for asking support questions. Your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php Thank you for your interest in PHP. Previous Comments: ------------------------------------------------------------------------ [2002-08-02 17:20:18] dhoherd@actiontec.com 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 ']'" ------------------------------------------------------------------------ [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 (#15873) next »