While trying to learn a little more about regular expressions, a tutorial suggested that you can use the \\b to match a word boundary. However, the following sn
\\b
This will work: re.search(r"\btwo\b", x)
re.search(r"\btwo\b", x)
When you write "\b" in Python, it is a single character: "\x08". Either escape the backslash like this:
"\b"
"\x08"
"\\b"
or write a raw string like this:
r"\b"