Is there a workaround to compare a text to a pattern in VBA, where the text may contain zero, one or more whitespaces between any two characters?
The text is imported from a bad quality scanned pdf through Acrobat API, for example the original "apple" word in the pdf may end up as "apple" or "a p p l e" or "app l e" or "a pp le" or any other in my text.
check1 = "apple123" Like "apple###"'true
check2 = "apple123" Like "a*p*p*l*e*###" 'true
check3 = "apple123" Like "a p p l e ###" 'false, this is not working
check3 = "a p p l e 123" Like "a*p*p*l*e*###" 'true
check4 = "appricotle123" Like "a*p*p*l*e*###" 'sadly also true, this will find bunch of others
I was hoping for [, ] to use instead of * so searching for nothing or space from a list is working, but the nothing is omitted.
Of course my patterns are more complicated eg. "*decree?###/20##", but solving the main issue is how to get over random spaces.