Simplifying regex OR patterns

后端 未结 3 1623
后悔当初
后悔当初 2021-02-09 23:57

I was asked today if there was a library to take a list of strings and to compute the most efficient regex to match only those strings. I think it\'s an NP Complete problem by i

3条回答
  •  旧时难觅i
    2021-02-10 00:12

    Regexp::Assemble::Compressed / Regexp::Assemble know far more tricks than PreSuf. R::A comes with the command-line tool assemble (not installed by default) which makes building regexes even easier.

提交回复
热议问题