boundary = re.compile('^.{0,30}(\\b)')
boundary.search('hello, world; goodbye, world; I am not a pie').start(1)
boundary.search('hello, world; goodbye, world; I am not').start(1)
boundary.search('hello, world; goodbye, world; I am').start(1)
boundary.search('hello, world; goodbye, pie').start(1)
boundary.search('hello, world; pie').start(1)
Can you search backwards from an offset using a Python regular expression?