See the example solution for how we used lookaheads to do this with pure regex.