What existing libraries are equivalent to Regexp:: Assembly in Ruby?

Asked 1 years ago, Updated 1 years ago, 95 views

I am looking for an existing Ruby library equivalent to Regexp::Assemble and Regexp::Trie for Perl and regexp-opt with Emacs.RubyGems if possible.

What you want is a method of creating a compact regular expression (string) that matches one of the many strings.For example, if "who""where""when" is given three strings, you expect results like "(?:wh(?:e(?:n|re)|o))" instead of "who|when".

Also, this is a question that you would like to know if there is an existing one, not the purpose of making it.So, just in case, the answers that show the code example that works above are contrary to the question's intentions.

ruby regular-expression rubygems

2022-09-30 21:09

1 Answers

regexp_tree has been registered with RubyGems as per the comment to the question.Close the question


2022-09-30 21:09

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.