Maybe a comment explaining how the regex is built in this way may help for future readers (including ourselves :)