Return all matches in an input string.
    :rtype : regex.match.span
    :param _regex: A regular expression pattern.
    :param _str: Text on which to run the pattern.
500172
def _regex_span(_regex, _str, case_insensitive=True):
    
    if case_insensitive:
        flags = regex.IGNORECASE | regex.FULLCASE | regex.VERSION1
    else:
        flags = regex.VERSION1
    comp = regex.compile(_regex, flags=flags)
    matches = comp.finditer(_str)
    for match in matches:
        yield match
128496
def _match(string, pattern):
    
    p = pattern
    try:
        if p[:1] == WILDCARD and (p[-1:] == WILDCARD and p[1:-1] in string or string.endswith(p[1:])):
            return True
        if p[-1:] == WILDCARD and not p[-2:-1] == "\\" and string.startswith(p[:-1]):
            return True
        if p == string:
            return True
        if WILDCARD in p[1:-1]:
            p = p.split(WILDCARD)
            return string.startswith(p[0]) and string.endswith(p[-1])
    except:
        # For performance, calling isinstance() last is 10% faster for plain strings.
        if isinstance(p, regexp):
            return p.search(string) is not None
    return False
421782
function getMatches(str, re) {
  if (str == null) {
    return null;
  }
  if (re == null) {
    return null;
  }
  var results = [];
  var match;
  while ((match = re.exec(str)) !== null) {
    results.push(match[1]);
  }
  return results;
}
1102241
def findall(self, string):
        
        output = []
        for match in self.pattern.findall(string):
            if hasattr(match, 'strip'):
                match = [match]
            self._list_add(output, self.run(match))
        return output
926321
def _process_regex(cls, regex, rflags, state):
        """"""
        if isinstance(regex, Future):
            regex = regex.get()
        return re.compile(regex, rflags).match
108635
def args_str(self):
        
        matched = [str(m) for m in self._matchers[:self._position]]
        unmatched = [str(m) for m in self._matchers[self._position:]]
        return 'matched=[{}], unmatched=[{}]'.format(
            ', '.join(matched), ', '.join(unmatched))
1204256
def regex_match(txt, rgx, ignorecase=False, multiline=False):
    '''
    
    '''
    flag = 0
    if ignorecase:
        flag |= re.I
    if multiline:
        flag |= re.M
    obj = re.match(rgx, txt, flag)
    if not obj:
        return
    return obj.groups()
83554
def extract_lookups_from_string(value):
    
    lookups = set()
    for match in LOOKUP_REGEX.finditer(value):
        groupdict = match.groupdict()
        raw = match.groups()[0]
        lookup_type = groupdict["type"]
        lookup_input = groupdict["input"]
        lookups.add(Lookup(lookup_type, lookup_input, raw))
    return lookups
1013735
def check(self, regex):
        
        return self.scan_full(regex, return_string=True, advance_pointer=False)
995869
def matches(self, event):
        '''
        
        '''
        ret = []
        self._matches(event, set(), ret)
        return tuple(r[0] for r in ret)
458047
def search(pattern, text):
    ''
    return re.compile(str(pattern)).search(str(text))
1112479
def regexp_prompt(prompt, regexp='.', answer=''):
    '''
    
    '''
    get_input = getattr(__builtins__, 'raw_input', input)
    while not re.search(regexp, answer):
        answer = get_input(prompt + ': ').strip()
        # If the option isn't valid, this is shown next
        message = "Your entry must match the regular expression %s" %regexp    

    return answer
1220722
def getRegexpsByName(regexpNames = ['all']):
    ''' 
        
    '''

    allRegexpList = getAllRegexp()
    if 'all' in regexpNames:
        return allRegexpList

    regexpList = []
    # going through the regexpList 
    for name in regexpNames:
        for r in allRegexpList:
            if name == r.name:
                regexpList.append(r)
    return regexpList
1087001
def parse_string(str_, validate=False):
    
    result = pattern.parseString(str_)[0]
    if validate:
        result.validate()
    return result
926697
def highlightAllMatches(self):
        
        # Remove any previous highlighting.
        self.qteWidget.SCISetStylingEx(0, 0, self.styleOrig)
        SCI = self.qteWidget

        # Compile a list of spans that contain the specified string.
        self.compileMatchList()

        # Return if the substring does not exist in the text.
        if len(self.matchList) == 0:
            return

        # ------------------------------------------------------------
        # Make a copy of the style bits of the document, overwrite
        # those parts containing a substring, and then write them
        # back all at once. This is much faster than calling the
        # styling methods repeatedly.
        # ------------------------------------------------------------

        # Make a copy of the document style bits and determine the
        # cursor position in the document.
        style = bytearray(self.styleOrig)
        pos = SCI.getCursorPosition()
        cur = SCI.positionFromLineIndex(*pos)

        # Style all matches.
        self.selMatchIdx = 0
        for start, stop in self.matchList:
            if start < cur:
                self.selMatchIdx += 1
            style[start:stop] = bytes(b'\x1e') * (stop - start)

        if self.selMatchIdx >= len(self.matchList):
            self.selMatchIdx = 0

        # Style the first match after the current cursor position
        # differently to indicate that it is the currently
        # selected one.
        start, stop = self.matchList[self.selMatchIdx]
        style[start:stop] = bytes(b'\x1f') * (stop - start)

        # Place the cursor at the start of the currently selected match.
        line, col = SCI.lineIndexFromPosition(start)
        SCI.setCursorPosition(line, col)

        # Apply the modified style array to the document.
        self.qteWidget.SCISetStylingEx(0, 0, style)
876790
function match(input, patterns = []){
	if(!patterns || 0 === patterns.length)
		return false;
	
	input    = String(input);
	patterns = arrayify(patterns).filter(Boolean);
	for(const pattern of patterns)
		if((pattern === input && "string" === typeof pattern)
		|| (pattern instanceof RegExp) && pattern.test(input))
			return true;
	return false;
}
383797
public static boolean isMatch(final String regex, final CharSequence input) {
        return input != null && input.length() > 0 && Pattern.matches(regex, input);
    }