code: def expand_ranges(value):
      
      match_dict = RANGE_REGEX.match(value).groupdict()  # the regex is supposed to always match..
      before = match_dict['before']
      after = match_dict['after']
      from_value = match_dict['from']
      if from_value is None:
          yield value
      else:
          # we have a [x-y] range
          from_value = int(from_value)
          to_value = int(match_dict['to']) + 1  # y is inclusive
          step = int(match_dict['step'] or 1)
          for idx in range(from_value, to_value, step):
              # yield "%s%s%s" % (before, idx, after)
              for sub_val in expand_ranges("%s%s%s" % (before, idx, after)):
                  yield sub_val
docs: :param str value: The value to be "expanded".
      :return: A generator to yield the different resulting values from expanding
               the eventual ranges present in the input value.
  
      >>> tuple(expand_ranges("Item [1-3] - Bla"))
      ('Item 1 - Bla', 'Item 2 - Bla', 'Item 3 - Bla')
      >>> tuple(expand_ranges("X[1-10/2]Y"))
      ('X1Y', 'X3Y', 'X5Y', 'X7Y', 'X9Y')
      >>> tuple(expand_ranges("[1-6/2] [1-3]"))
      ('1 1', '1 2', '1 3', '3 1', '3 2', '3 3', '5 1', '5 2', '5 3')