I need a RegEx that will find a specific word within a long string. The issue is that this word may be misspelled and I need to find it even so. I would like to accept a certain percentage of wrong-ness when looking for the word. Ex.
The complete string: Hello, this is my comp/et sting to look at
The word to search for: complete
Let’s say that I which to accept a maximum of two wrong letters in the above string, then the RegEx should match the word complete. However, if I only accept 1 wrong letter it shouldn’t find it. Ideally the RegEx would also be able to handle whitespaces, and missing letters. Ex:
The complete string: Hello, this is my com plee sting to look at
The word to search for: complete
This should match the word as well, even though there is a whitespace between ‘m’ and ‘p’ and the letter ‘t’ is missing.
Is this possible at all with RegEx or should I be looking at an alternative way to solve it?
Thanks, Tommy