I am not familiar with regex in VBA but have to debug a code written by someone else.
I understand that \b matches a position based on word boundaries and excludes non-word characters like -.
However, I need the code to match the - that are in some strings.
For example,
Match cats and dogs in the search_criteria: i have cats and dogs with the code:
"\b" & search_criteria & "\b"
works.
However, this doesn't come up with a match:
dogs - in the search_criteria: dogs - sleeping
doesn't work.
The search_criteria is a list that contains strings that don't end with - and strings that end with -.
Like this:
dogs -
cats -
cats and dogs
houses
cars
work -
I basically have to change the \b at the end of the code but need help with this:
"\b" & search_criteria & "\b"