D
DA
I'm looking for suggestions on how to do a wildcard
search on a string held in memory.
Case:
varIn - is holding a string read from an external file.
(There's no open document)
term - is the search item I want to find in my varIn
Using:
If instr(varIn,term)<> 0 Then
'I've got a hit
Endif
Problem:
1)I do NOT want to return a hit if the term is found
inside a word (e.g. term = "BLE" varIn = "babble")
2)I DO want to return a hit if the term is found by
itself, at the end of a sentence, or in combination with
punctuation. (e.g. term = "BLE" varIn = "BLEs are useful
in combination with a BLE-generator." - should return
hits on both items.)
Building a long list of case statements is my last
resort, which I'm trying to avoid here.
I was hoping that I could do something with wildcards
(e.g. instr(varIn, term & [ ,s-_'.,])
Any ideas on a solution?
Dennis
search on a string held in memory.
Case:
varIn - is holding a string read from an external file.
(There's no open document)
term - is the search item I want to find in my varIn
Using:
If instr(varIn,term)<> 0 Then
'I've got a hit
Endif
Problem:
1)I do NOT want to return a hit if the term is found
inside a word (e.g. term = "BLE" varIn = "babble")
2)I DO want to return a hit if the term is found by
itself, at the end of a sentence, or in combination with
punctuation. (e.g. term = "BLE" varIn = "BLEs are useful
in combination with a BLE-generator." - should return
hits on both items.)
Building a long list of case statements is my last
resort, which I'm trying to avoid here.
I was hoping that I could do something with wildcards
(e.g. instr(varIn, term & [ ,s-_'.,])
Any ideas on a solution?
Dennis