added character sets to _regex_to_tree