Fixed regex! Much simpler and sensible implementation too.