note 110754 added to function.preg-match
| From: | espertalhao04 at hotmail dot com | Date: | Sun, 02 Dec 2012 14:28:36 +0000 |
| Subject: | note 110754 added to function.preg-match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-192247@lists.php.net to get a copy of this message | ||
hey everyone, i have a great function for you!
http://sandbox.onlinephpfunctions.com/code/dadcc9c5bd05fdc834b82396903b688ac408d5a6
i know this is against php policy, but php won't let post all the code in here...
it's small, but it's a really huge explaination...
this is simply a function that will match a string or array of strings OR an array of arrays with
the parameters $subject, $flags and $offset.
there is no restriction for the keys, EXCEPT for the pattern array:
it MUST be numeric.
you can match an array of patterns against a string or even an array of strings against a single
pattern
instead of a regex, you can put the keys \\last\\,\\first\\ or an empty string (usefull when
matching agains one single regex)
\\last\\ refers to the last used regex (if you use after \\first\\, you will end up having the 1st
regex)
\\first\\ refers to the very first regex used!!!
this value won't change
an empty string has the same meaning as \\last\\
you can see it working on that website...
i hope this is useful for you.
----
Server IP: 194.8.30.16
Probable Submitter: 85.240.4.7
----
Manual Page -- http://www.php.net/manual/en/function.preg-match.php
Edit -- https://master.php.net/note/edit/110754
Del: integrated -- https://master.php.net/note/delete/110754/integrated
Del: useless -- https://master.php.net/note/delete/110754/useless
Del: bad code -- https://master.php.net/note/delete/110754/bad+code
Del: spam -- https://master.php.net/note/delete/110754/spam
Del: non-english -- https://master.php.net/note/delete/110754/non-english
Del: in docs -- https://master.php.net/note/delete/110754/in+docs
Del: other reasons-- https://master.php.net/note/delete/110754
Reject -- https://master.php.net/note/reject/110754
Search -- https://master.php.net/manage/user-notes.php