Why does the regex look so complicated?