Move regex back into _toRegex method