in reply to Regular Expression (Regex) Sieve

Based on your last paragraph, Approach 2 and 3 are nowhere near as good as Approach 1.

You want overlapping matches of different patterns. Do you want overlapping matches of the same pattern?

Do you need to know which pattern matched which result?

Replies are listed 'Best First'.
Re^2: Regular Expression (Regex) Sieve
by Wiggins (Hermit) on Jul 14, 2009 at 18:40 UTC
    I fully agree that the last constraint pretty much forces Approach #1. But it is just an after thought.

    Overlaps of different patterns could be more significant that within a pattern. When the patterns are supplied by different people, the "overlap" wouldn't be seen by either creator. While any single pattern should be structured by that creator to be work as they want when processes with a \g modifier.

    Each pattern will have an assigned weight. Each match will add that pattern's weight to the document's score. The final document score is what I am really after. So the answer is 'yes'.

    Thanks

    It is always better to have seen your target for yourself, rather than depend upon someone else's description.