Regex optimisation suggested by @Skeeve