I'm trying to find the location of a substring of text within a much larger string that contains question mark wildcard characters. The large string is the results of imprecise OCR software, and it contains wildcards because it could tell there was a character there, but couldn't identify which one.
Here's an oversimplified example of what I'd like to accomplish.
Dim resultIndex As Integer = -1
Dim LargeOcrText As String = "fAsD ?GjSDFpG HjDYA?C JLgD FHaYsV MKiI?oL XgXj?GN sHVKgG?"
Dim searchText As String = "ABC"
If searchText Like LargeOcrText Then resultIndex = LargeOcrText.IndexOf(searchText)
This should return a resultIndex = 18, but it doesn't work, even if I use searchText = "*ABC*" instead. I'm almost certain there's some way I can use regular expressions to do the Like comparison, but I'm not very practiced with them, and even then I'm at a complete loss for how to get the index of the substring.
Edit: To be clear, I'm aware that neither Like nor IndexOf support what I'm trying to do. That's exactly my problem. I'm searching for some other way to code it that does work.