I think a regex is not a good approach to check for typos and similar strings. I would consider something like levenshtein - PHP even has a native function for that, levenshtein
.
EDIT: Depending on what you're looking for, there are other algorithms too that are also native in PHP: soundex
(although considered superseded by newer approaches like Double Metaphone), metaphone
, similar_text
.
EboMike
2010-10-28 19:11:28