Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is re2j able to combine multiple regex into one? #14

Open
wihoho opened this issue Oct 8, 2015 · 1 comment
Open

Is re2j able to combine multiple regex into one? #14

wihoho opened this issue Oct 8, 2015 · 1 comment

Comments

@wihoho
Copy link

wihoho commented Oct 8, 2015

Basically, if there is a large number of regular expression, it can be quite slow to match target strings. So I am looking for solutions to "compile" many regular expressions into "one".

https://github.com/fulmicoton/multiregexp provides a solution to build a large DFA based on each DFA built from each regex. However, it has many limitations - only a subset of regex is supported.

Is there a way to achieve what I want using re2j? I tried hard but could not find related info.

Thanks in advance.

@ericruel
Copy link

I agree that that feature would be interesting.
Something like https://code.google.com/p/esmre/ would be great.

maybe by only adding the support of the groupNames, we could create something like
((?perl)|(?java\W?script)|(?java)|(?(visual\W?basic|vb)))

and with the list of group names, we could know what has matched

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants