def _multiple_range_string_to_set(ranges_str):
 char_set = set()
 for range_str in ranges_str.split(', '):
  if range_str.startswith('and '):
   range_str = range_str[4:]
  char_set.update(_range_string_to_set(range_str))
 return char_set

def _multiple_range_string_to_set ( ranges_str ) : char_set = set ( ) for range_str in ranges_str . split ( ', ' ) : if range_str . startswith ( 'and ' ) : range_str = range_str [ 4 : ] char_set . update ( _range_string_to_set ( range_str ) ) return char_set
convert a string of multiple ranges to a set .