note 110754 deleted from function.preg-match by aharvey
| From: | aharvey@php.net | Date: | Mon, 03 Dec 2012 01:15:07 +0000 |
| Subject: | note 110754 deleted from function.preg-match by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-192256@lists.php.net to get a copy of this message | ||
Note Submitter: espertalhao04 at hotmail dot com
----
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.