I have a list of strings and I am trying to run a regex search on it.
I use:
re.search(r"\b" + word + r"\b", list[item], re.I)
Yet, the result of the search doesn't take into account the word boundaries and still returns wrong results. Example:
when word is try
and i run the test, it still returns True for trying
or country
.
What am I doing wrong?