I have following words:
is\s?(this|that|it)\s?true\s[?]?
^real$
^reall[y]*[\s]?[?]*$
wh[a]*[t]*[?!][?]*
For every string, I have to search if any of these words are present in the string.
Whats the best way to do it?
I have tried using:
re.search(
'is\s?(this|that|it)\s?true\s[?]?|^real$|^reall[y]*[\s]?[?]*$|wh[a]*[t]*[?!][?]*',
string)
But it is very slow. Is there a better way to do this?