note 41081 deleted from function.preg-replace by aidan

From: Date: Sun, 05 Dec 2004 15:17:47 +0000
Subject: note 41081 deleted from function.preg-replace by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-81405@lists.php.net to get a copy of this message
Note Submitter: ---- <Quote> Peter 01-Nov-2003 03:00 Suppose you want to match '\n' (that's backslash-n, not newline). The pattern you want is not /\\n/ but /\\\\n/. The reason for this is that before the regex engine can interpret the \\ into \, PHP interprets it. Thus, if you write the first, the regex engine sees \n, which is reads as newline. Thus, you have to escape your backslashes twice: once for PHP, and once for the regex engine. </Quote> Well Peter seems to have solved this, I hope you all realise it, as this little \" disaster in my flash -> php work is now solved with this little resolve as well. Thanks Peter, Rick - chatdev.com

« previous php.notes (#81405) next »