David, > Enclosed is a patch to allow PCRE's preg_split to return an array of > (match, offset) pairs, if PREG_SPLIT_OFFSET_CAPTURE is or'd into the > flags parameter. Submitted for inclusion, rejection, extensive flaming, > or suggestions. :)
I've applied the patch with some modifications. Notably, when PREG_SPLIT_DELIM_CAPTURE was along with this new flag, the delimiters were not being captured with offsets. I also abstracted the match pair addition into a separate (inlined) function. -Andrei http://www.gravitonic.com/ -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php