Returns true if any of the selected options' text or label matches the given value.

 @param [String, Regexp] str_or_rx
 @raise [Watir::Exception::UnknownObjectException] if the options do not exist
 @return [Boolean]
186340
def selected?(str_or_rx)
      by_text = options(text: str_or_rx)
      return true if by_text.find(&:selected?)

      by_label = options(label: str_or_rx)
      return true if by_label.find(&:selected?)

      return false unless (by_text.size + by_label.size).zero?

      raise(UnknownObjectException, "Unable to locate option matching #{str_or_rx.inspect}")
    end
1031156
def matches(text, what):
    '''
    
    
    '''
    return text.find(what) > -1 if is_string(what) else what.match(text)
412687
def if_match(self, values):
        
        assert isinstance(values, list)
        for v in values:
            option = Option()
            option.number = defines.OptionRegistry.IF_MATCH.number
            option.value = v
            self.add_option(option)
227646
def _matching_string(matched, string):
        
        if string is None:
            return string
        if IS_PY2:
            # pylint: disable=undefined-variable
            if isinstance(matched, text_type):
                return text_type(string)
        else:
            if isinstance(matched, bytes) and isinstance(string, str):
                return string.encode(locale.getpreferredencoding(False))
        return string
1167120
private boolean isValid(String response, List<String> options) {

		boolean rslt = false;	// default...

		if (options.size() == 0) {
			// If no acceptable responses are specified, it's wide open...
			rslt = true;
		} else {
			for (String o : options) {
				if (response.matches(o)) {
					rslt = true;
					break;
				}
			}
		}
		
		return rslt;
		
	}
296673
def _find_combo_text(widget, value):
    
    i = widget.findText(value)
    if i == -1:
        raise ValueError("%s not found in combo box" % value)
    else:
        return i
717596
private static boolean isEqualWithMatching(final Object option, final Object data) {
		return Util.equals(option, data) || isOptionCodeMatch(option, data) || isLegacyMatch(option,
				data);
	}
58006
def match?(arr, parser=nil)
      arr = arr.to_a
      return false if arr.length != self.length
      each_with_index do |node, i|
        node.match?(arr[i], parser) or return false
      end
      return true
    end
906740
def or_(cls, obj, **kwargs):
        
        return cls.__eval_seqexp(obj, operator.or_, **kwargs)
1090074
def get_or_else(val_or_lam = nil, &blk)
      v_or_f = val_or_lam || blk
      if !empty? then value else (v_or_f.respond_to?(:call) ? v_or_f.call : v_or_f) end
    end
421036
def input_has_value(self, field_name, value):
    
    text_field = find_any_field(world.browser,
                                DATE_FIELDS + TEXT_FIELDS,
                                field_name)
    if text_field is False:
        raise AssertionError(
            "Can not find a field named {!r}.".format(field_name))

    actual = text_field.get_attribute('value')
    if actual != value:
        raise AssertionError(
            "Field value expected to be {!r}, got {!r}.".format(
                value, actual))
201956
def value_text(self):
        
        search = self._selected.get() # a string containing the selected option
        # This is a bit nasty - suggestions welcome
        for item in self._rbuttons:
            if item.value == search:
                return item.text
        return ""
1204939
def add_blank_option(regexp, blank)
      case blank
        when String then Regexp.union(regexp, Regexp.new(Regexp.quote(blank)))
        when true then   Regexp.union(regexp, //)
        else regexp
      end
    end
1365928
def text
      assert_exists

      # A little unintuitive - we'll return the 'label' or 'text' attribute if
      # they exist, otherwise the inner text of the element

      attribute = [:label, :text].find { |a| attribute? a }

      if attribute
        @element.get_attribute(attribute)
      else
        @element.text
      end
    end
404364
def select!(*str_or_rx)
      results = str_or_rx.flatten.map { |v| select_by!(v, :single) }
      results.first
    end
865584
def options_match?(request)
      (options ? options.all?{ |k,v| request.original_options[k] == v || request.options[k] == v } : true)
    end
1082769
def include?(str_or_rx)
      option(text: str_or_rx).exist? || option(label: str_or_rx).exist?
    end