Fuzzy Regular Expressions
Posted
by Thomas Ahle
on Stack Overflow
See other posts from Stack Overflow
or by Thomas Ahle
Published on 2010-02-28T16:08:14Z
Indexed on
2010/04/04
10:33 UTC
Read the original article
Hit count: 499
In my work I have with great results used approximate string matching algorithms such as Damerau–Levenshtein distance to make my code less vulnerable to spelling mistakes.
Now I have a need to match strings against simple regular expressions such TV Schedule for \d\d (Jan|Feb|Mar|...)
. This means that the string TV Schedule for 10 Jan
should return 0 while T Schedule for 10. Jan
should return 2.
This could be done by generating all strings in the regex (in this case 100x12) and find the best match, but that doesn't seam practical.
Do you have any ideas how to do this effectively?
© Stack Overflow or respective owner