I would like to get 2 captured groups for a pair of consecutive words. I use this regular expression:
r'\b(hello)\b(world)\b'
However, searching "hello world" with this regular expression yields no results:
regex = re.compile(r'\b(hello)\b(world)\b')
m = regex.match('hello world') # m evaluates to None.
<boundary>hello<boundary>world<boundary>, but you're trying to match on the string<boundary>hello<boundary><space><boundary>world<boundary>.re.findallorre.finditerinstead.