Distance between regular expression

后端 未结 6 1244
春和景丽
春和景丽 2021-02-14 14:46

Can we compute a sort of distance between regular expressions ?

The idea is to mesure in which way two regular expression are similar.

6条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-14 15:04

    I suppose you could compute a Levenshtein Distance between the actual Regular Experssion strings. That's certainly one way of measuring a "distance" between two different Regular Expression strings.

    Of course, I think it's possible that regular expressions are not required here at all, and computing the Levenshtein Distance of the actual "value" strings that the Regular Expressions would otherwise be applied to, may yield a better result.

提交回复
热议问题