I have a problem where I am trying to search for a substring in string. That substring may or may not be in the string.
str = \"hello how are you?\"
substr =
To my knowledge there's no "magic" way to search for substrings really fast, unless you're ready to build some kind of search metadata (think index) beforehand. Doing so will most likely waste more time than it saves you unless you search through the same string a lot.
As the search pattern is simple, I would steer clear of regex.