Hacker News new | ask | show | jobs
by lespea 4454 days ago
I actually do the combining idea all the time. As long as the language is roughly pcre compatible you can use this to spit out your regex and (if necessary for your alternate language tweak it a bit so it fits).

I've generated some very massive regex's that are quite speedy.

Merger

  https://metacpan.org/pod/Regexp::Assemble
These are also super handy

  https://metacpan.org/pod/Number::Range::Regex
  https://metacpan.org/pod/Regexp::Common
1 comments

Yeah, Regexp::Assemble was what I had in mind. There's a few that try to generate a list of matching strings from the expression, but I've never been satisfied with their output. Either they're slow, or don't let you constrain the regex, and all of them don't generate comprehensive lists for some reason.