Regex error 'missing terminating ] for character class at offset 3'