>>> a = """if HELLO
... do something"""
>>> b = b"""if HELLO
... do something"""
>>> if re.search(r"HELLO\b", a):
...     print('yes')
...
yes
>>> if re.search(b"HELLO\b", b):
...     print('yes')
...
>>>
Is there any way to use \b when searching through bytestrings? Or is there another option that does the same thing as \b?