I have a regular expression created from a list in the database to match the names of the building types in the game. The problem is that typos, sometimes those who write instructions for their team in the game, will mistakenly name the building name, and obviously the regular expression will not pick it up (for example, the spelling "University" and "Unlimited").
Are there any suggestions for making matches match regular expressions with 1 or 2 letters?
A regular expression is regularly generated and launched on a local machine that can handle much more workload, so in the worst case I have algorithmic versions of each word with an absent letter, and then another with added letters.
I use PHP, but I hope that any solution to this problem will not be specific to PHP.
regex
Teifion
source share