Use lookahead/lookbehind matches to simplify a bit