note 85364 added to function.preg-split

From: Date: Wed, 27 Aug 2008 13:55:58 +0000
Subject: note 85364 added to function.preg-split
Groups: php.notes 
Request: Send a blank email to php-notes+get-143881@lists.php.net to get a copy of this message
I response to the post of "harrismw at ids dot org dot au" below: it *is* just as simple as escaping characters! Characters the question mark ('?'), the dollar sign ('$') and all types of "braces" ('(', ')', '{', '}', '[', ']') have special meaning in regular expressions. As noted in the manual above, if you don't need the power and flexibility that regular expressions provide (i.e. you are looking to split on a specific literal string) then you are better off using functions like explode(). ---- Server IP: 64.71.164.2 Probable Submitter: 12.47.22.186 ---- Manual Page -- http://www.php.net/manual/en/function.preg-split.php Edit -- https://master.php.net/note/edit/85364 Del: integrated -- https://master.php.net/note/delete/85364/integrated Del: useless -- https://master.php.net/note/delete/85364/useless Del: bad code -- https://master.php.net/note/delete/85364/bad+code Del: spam -- https://master.php.net/note/delete/85364/spam Del: non-english -- https://master.php.net/note/delete/85364/non-english Del: in docs -- https://master.php.net/note/delete/85364/in+docs Del: other reasons-- https://master.php.net/note/delete/85364 Reject -- https://master.php.net/note/reject/85364 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#143881) next »