Regex performance fix