add _get_pattern to get the string of a regex