regex - Distance between regular expression -
Can we calculate a distance between regular expressions?
How is the idea that two regular expressions are similar?
There are some metrics you can use:
-
The length of a valid match is a few regexs, a certain size, some one upper limit and some have a lower limit. Compare what their length or potential length is.
-
The characters that match. Any regex will have a set of characters that can be in a match (probably all the characters). Compare the set of characters included.
-
Use a larger document and see how many each regex matches and how many of them are similar.
Are you looking for tough equivalence?
Comments
Post a Comment