|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-09-20 13:16 UTC] sniper@php.net
[2005-09-20 13:27 UTC] techtonik@php.net
[2005-09-20 13:44 UTC] vrana@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 12:00:02 2025 UTC |
Description: ------------ Usually, if you want to match a backslash, you write "\\", but this doesn't work no matter what kind of quotes do you use. Reproduce code: --------------- <?php $str = 'slash\replace'; echo $str = preg_replace('!\\+!', '/', $str); preg_replace('![/\\]+!', '/', $str); // warning ?> Expected result: ---------------- slash/replace Actual result: -------------- slash\replace Warning: preg_replace(): Compilation failed: missing terminating ] for character class at offset 5 i n C:\MyFiles.XFiles\Numerald\tc\test69\testcase.php on line 7