import re
s = "hello a world today b is sunny c day"
markers = "a b c".split()
pattern = r'\b(' + ' (?:\w+ )?(?:\w+ )?'.join(markers) + r')\b'
print(pattern)
text = re.sub(pattern, r'<b>\1</b>', s)
print(text)
print(re.sub(r'\b' + ' (?:\w+ )?(?:\w+ )?'.join(markers) + r'\b', r'<b>\g<0></b>', s))