Click to See Complete Forum and Search --> : flexible string matching reg exp


bigajosep
09-22-2008, 03:12 PM
If I have a mysql database of words, is there a function or regular expression that would match anything that is one or two characters off? I know with mysql LIKE you can have a wildcard character "_", so would I just have to test all permutations like _XXX, X_XXX, XX_X, etc or is there some syntax that would do this for me?
thanks

ellisgl
09-22-2008, 04:08 PM
Great if you are looking for all possible combination's for what is given.
http://www.charles-reace.com/PHP_and_MySQL/Anagram_Finder/index.php

You could look at soundex functions
http://us2.php.net/soundex

Or make something that takes XXXX, loops thru the amount of chars
and makes a query of `column` LIKE '_XXXX' OR `column` LIKE 'X_XXX'.....