How can I rewrite my anchor to be more general and correct in all situations? I have understood that using \b as an anchor is not optimal because it is implementation-dependent.
My goal is to match some type of word in a text file. For my question, the word to match is not of importance.
Assume \b is the word boundary anchor and a word character is [a-zA-Z0-9_] I constructed two anchors, one for the left and one for the right side of the regex. Notice how I handle the underscore, as I don't want it to be a word character when I read my text file.
(?<=\b|_)positive lookbehind(?=\b|_)positive lookahead
What would be the equivalent anchor constructs but using the more general caret ^ and $ dollar sign to get the same effect?
\b. Lookarounds are newer and not available as widely.*,|,\...