In regular expressions you can have multiple pattern matches. Often times a regular expression will have multiple matches and programming languages often let you loop through the returned matches. For instance, applying a pattern of
[0-9]{4}, which looks for a series of four numbers in a row, would return two matches for
(1234)(4567). One matching
1234 and the other matching
4567. Often time regular expressions have a way of putting these matches in an array which then you could loop through with a for each loop or even a while loop would work.
Now you could use two separate calls to a regular expression which gives you results. One to split the string and another to pull out matches. Just make sure you take copies of the original string to work on so that your split doesn't destroy the string that you want to then pull matches out of.
Hopefully that answers your question.
This post has been edited by Martyr2: 31 Oct, 2007 - 08:21 PM