note 107768 added to regexp.reference.delimiters
| From: | adelbenzarti at yahoo dot fr | Date: | Fri, 02 Mar 2012 23:09:41 +0000 |
| Subject: | note 107768 added to regexp.reference.delimiters | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-186472@lists.php.net to get a copy of this message | ||
When you use meta-characters in the regular expression, avoid using them as delimiters. In
preference, do not use the meta-characters as delimiters at all.
Besides, you must not forget to escape the delimiter if it exists in the user text. The function
preg_quote permits to escape the delimiter if it exists in the user text.
<?php
$usertext=preg_quote($usertext,$delimiter);
?>
----
Server IP: 69.147.83.197
Probable Submitter: 41.227.178.172
----
Manual Page -- http://www.php.net/manual/en/regexp.reference.delimiters.php
Edit -- https://master.php.net/note/edit/107768
Del: integrated -- https://master.php.net/note/delete/107768/integrated
Del: useless -- https://master.php.net/note/delete/107768/useless
Del: bad code -- https://master.php.net/note/delete/107768/bad+code
Del: spam -- https://master.php.net/note/delete/107768/spam
Del: non-english -- https://master.php.net/note/delete/107768/non-english
Del: in docs -- https://master.php.net/note/delete/107768/in+docs
Del: other reasons-- https://master.php.net/note/delete/107768
Reject -- https://master.php.net/note/reject/107768
Search -- https://master.php.net/manage/user-notes.php