Automatic regex builder

前端 未结 3 1331
误落风尘
误落风尘 2020-12-17 05:21

I have N strings. Also, there are K regular expressions, unknown to me. Each string is either matching one of the regular expressions, or it is garbage. There are total of

3条回答
  •  长情又很酷
    2020-12-17 06:27

    What you are trying to do is language learning or language inference with a twist: instead of generalising over a set of given examples (and possibly counter-examples), you wish to infer a language with a small yet specific grammar.

    I'm not sure how much research is being done on that. However, if you are also interested in finding the minimal (= general) regular expression that accepts all n strings, search for papers on MDL (Minimum Description Length) and FSMs (Finite State Machines).

    Two interesting queries at Google Scholar:

    • "minimum description length" automata
    • "language inference" automata

提交回复
热议问题