I’m trying to use Regex to check if keyword is found in a string and should be an exact match. Currently, I have tried to use boundary, \b[keyword]\b but it accepts special characters. I need exact matching for alphanumeric only.
sample:
Keyword = test
Expected Output:
This is a test //found
This is a -test+ //not found
This is a justatest for demo-purposes //not found
This is a test if regex is working //found
Test is working //found
Hi @ptrobot , forgot to mention that I’m using this regex line inside a macro text file and using Invoke VBA. Seems like positive lookbehind is not working for VBA, are you able to confirm? Thanks
No, it doesn’t seem like VBA regex supports lookbehind at all. But you can remove it and still get the same result (i.e. if the key word exists or not.)