note 111573 added to function.preg-match

From: Date: Tue, 05 Mar 2013 13:48:14 +0000
Subject: note 111573 added to function.preg-match
Groups: php.notes 
Request: Send a blank email to php-notes+get-193903@lists.php.net to get a copy of this message
There does not seem to be any mention of the PHP version of switches that can be used with regular expressions. As this varies widely with languages it should be mentioned somewhere here. Anyway, I found this link http://stackoverflow.com/questions/2240348/php-preg-replace-regex-that-matches-multiple-lines. However, if the link does not work here is a summary. preg_match_all('/regular expr/sim',$text). The s i m being the location for and available switches (I know about) The i is to ignore letter cases (this is commonly known - I think) The s tells the code NOT TO stop searching when it encounters \n (line break) - this is important with multi-line entries for example text from an editor that needs search. The m tells the code it is a multi-line entry, but importantly allows the use of ^ and $ to work when showing start and end. I am hoping this will save someone from the 4 hours of torture that I endured, trying to workout this issue. ---- Server IP: 69.147.83.199 Probable Submitter: 80.175.146.233 ---- Manual Page -- http://php.net/manual/en/function.preg-match.php Edit -- https://master.php.net/note/edit/111573 Del: integrated -- https://master.php.net/note/delete/111573/integrated Del: useless -- https://master.php.net/note/delete/111573/useless Del: bad code -- https://master.php.net/note/delete/111573/bad+code Del: spam -- https://master.php.net/note/delete/111573/spam Del: non-english -- https://master.php.net/note/delete/111573/non-english Del: in docs -- https://master.php.net/note/delete/111573/in+docs Del: other reasons-- https://master.php.net/note/delete/111573 Reject -- https://master.php.net/note/reject/111573 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#193903) next »