how to find all matching regexps?

Max Spring <>
8 Nov 2001 01:15:46 -0500

          From comp.compilers

Related articles
how to find all matching regexps? (Max Spring) (2001-11-08)
| List of all articles for this month |

From: Max Spring <>
Newsgroups: comp.compilers
Date: 8 Nov 2001 01:15:46 -0500
Organization: Cisco Systems Inc.
Keywords: lex, question
Posted-Date: 08 Nov 2001 01:15:46 EST

I have a set S of regular expressions which gets built at runtime.
For a given input string t, I want to efficiently determine *all*
regular expressions out of S which match t.

The actual match operation must be as time-efficient as possible,
while constructing any helper data structure during startup when S is
known may take some time.

The approach which I see so far goes to constructing an NFA for S
(pretending S = e1 | e2 | ... | en) where each final state holds
references to appropriate representations of the corresponding regular

Now my question: Instead of writing everything from scratch, is there
any regular expression library which is usable as a foundation for
this purpose? (Preferrably in Java)

Further suggestions or comments are highly appreciated.
-Max Spring

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.