basically, when you find a match, you'd start search for further matches that occur strictly after existing matches. i guess it makes sense to let it find all the matches first, then to look for further matches that occur after them. and basically to repeat this for further parts.