Before you overthink it: This last version is completely overkill for your use case.
But as I wasn't sure if you need to match characters in a string as your code suggest, or words in a string as one of your post mentioned... This one can do both.
Before you overthink it: This last version is completely overkill for your use case.
But as I wasn't sure if you need to match characters in a string as your code suggest, or words in a string as one of your post mentioned... This one can do both.