why \b doesn't work in python re module?
python, regex
Solution
You need to use a raw string, or else the `\b` is interpreted as a string escape. Use `r'\baaa\b'`. (Alternatively, you can write `'\\b'`, but that is much more awkward for longer regexes.)
Problem
It is known that `\b` means word boundary in regular expression. However the following code of `re` module in python doesn't work: ``` >>> p=re.compile('\baaa\b') >>> p.findall("aaa vvv") [] ``` I think the returned results of `findall` should be `["aaa"]`, however it didn't find anything. What's the matter?