http://www.perlmonks.org?node_id=1008540


in reply to Find all strings containing "a" characters, that are not followed by "b" characters.

Try
/a(?!b)/
with negative lookahead.

And yes, your regexp looks rather OK, except I would drop a few \b anchors:

/a\b|a[^b]/
or combined:
/a(\b|[^b])/
Will that do?