I have several regexes (actually several thousands), and I must check if one string matches any of these regexes. It is not very efficient, so I would like to merge all these regexes as a single regex.
For example, if a have these regexes:
- 'foo *bar'
- 'foo *zip'
- 'zap *bar'
I would like to obtain something like 'foo *(bar|zip)|zap *bar'.
Is there some algorithm, library or tool to do this?