Visitor looking for matching between current node and pattern.

        If it match, save it but whatever happen, keep going.
10807
def visit(self, node):
        
        if Check(node, dict()).visit(self.pattern):
            self.result.add(node)
        self.generic_visit(node)
502420
def file_matches(filename, patterns):
    """"""
    return any(fnmatch.fnmatch(filename, pat)
               or fnmatch.fnmatch(os.path.basename(filename), pat)
               for pat in patterns)
375942
def match_all(data, &block)
      return nil if @root == nil
      i=0
      while (i<data.length)
        node = @root.find_forward(data, i, data.length-i)
        if (node!=nil && node.value!=nil)
          yield Item.new(i, true, node)
          i += node.length
        else
          i += 1
        end
      end
    end
985511
def find_re(self, pattern):
        """"""
        # TODO: Reduce redundancy with RAFArchive
        pattern = re.compile(pattern, re.I)
        for k, v in six.iteritems(self.entries_full):
            if pattern.search(k):
                # Most recent version will be last
                yield v[-1]
312148
def match(self, node, results=None):
        """"""
        if not isinstance(node, Leaf):
            return False
        return BasePattern.match(self, node, results)
848149
function verify(context, node, pattern, flags) {
    try {
        let found = false

        new RegExpValidator({
            onLookaroundAssertionEnter(_start, kind) {
                if (kind === "lookbehind") {
                    found = true
                }
            },
        }).validatePattern(pattern, 0, pattern.length, flags.includes("u"))

        if (found) {
            context.report({ node, messageId: "forbidden" })
        }
    } catch (error) {
        //istanbul ignore else
        if (error.message.startsWith("Invalid regular expression:")) {
            return
        }
        //istanbul ignore next
        throw error
    }
}
478166
def compare(self, origin, pattern):
        

        if origin is None or pattern is None:
            return False
        return re.match(pattern, origin) is not None
1333886
def _match_iter_single(self, path_elements, start_at):
        """"""

        length = len(path_elements)

        if length == 0:
            return

        # If bound to end, we start searching as late as possible
        if self.bound_end:
            start = length - 1
            if start < start_at:
                return
        else:
            start = start_at

        # If bound to start, we stop searching at the first element
        if self.bound_start:
            end = 1
        else:
            end = length
            if start > end:
                # It's impossible to match
                # the search has a fixed start and end, and path_elements
                # does not have enough elements for a match, or
                return

        for index in range(start, end):
            element = path_elements[index]
            if self.elements[0].match(element):
                yield index + 1
1014044
function Finder(node, options) {

    var preset = options.preset && exposed.PRESETS[options.preset]
    options.portionMode = options.portionMode || PORTION_MODE_RETAIN
    if (preset) {
      for (var i in preset) {
        if (hasOwn.call(preset, i) && !hasOwn.call(options, i)) {
          options[i] = preset[i]
        }
      }
    }

    this.node = node
    this.options = options
    // ENable match-preparation method to be passed as option:
    this.prepMatch = options.prepMatch || this.prepMatch
    this.reverts = []
    this.matches = this.search()
    if (this.matches.length) {
      this.processMatches()
    }

  }
1258296
def _match_iter_generic(self, path_elements, start_at):
        """"""

        length = len(path_elements)
        # If bound to start, we stop searching at the first element
        if self.bound_start:
            end = 1
        else:
            end = length - self.length + 1

        # If bound to end, we start searching as late as possible
        if self.bound_end:
            start = length - self.length
        else:
            start = start_at

        if start > end or start < start_at or end > length - self.length + 1:
            # It's impossible to match. Either
            # 1) the search has a fixed start and end, and path_elements
            #    does not have enough elements for a match, or
            # 2) To match the bound_end, we have to start before the start_at,
            #    which means the search is impossible
            # 3) The end is after the last possible end point in path_elements
            return

        for index in range(start, end):
            matched = True
            i = index
            for matcher in self.elements:
                element = path_elements[i]
                i += 1
                if not matcher.match(element):
                    matched = False
                    break
            if matched:
                yield index + self.length
489498
def match_seq(self, nodes, results=None):
        
        if len(nodes) != 1:
            return False
        return self.match(nodes[0], results)
718419
function match (el, selector) {
  if (!el || el.nodeType !== 1) return false
  if (vendor) return vendor.call(el, selector)
  var nodes = all(selector, el.parentNode)
  for (var i = 0; i < nodes.length; ++i) {
    if (nodes[i] === el) return true
  }
  return false
}
186332
def check(self, pattern):
        
        if self.eos:
            raise EndOfText()
        if pattern not in self._re_cache:
            self._re_cache[pattern] = re.compile(pattern, self.flags)
        return self._re_cache[pattern].match(self.data, self.pos)
988202
def find(self, pattern):
        
        findFailedRetry = True
        while findFailedRetry:
            match = self.exists(pattern)
            if match is not None:
                break
            path = pattern.path if isinstance(pattern, Pattern) else pattern
            findFailedRetry = self._raiseFindFailed("Could not find pattern '{}'".format(path))
            if findFailedRetry:
                time.sleep(self._repeatWaitTime)
        return match
319025
function find(pathname, patterns) {
  for (const entry of patterns)
    if (minimatch(pathname, entry.pattern))
      return entry.handler
  return null
}
633580
def match?(str, parser=nil)
      node = self.class.parse(str.to_s, parser) rescue (return false)
      self == node
    end
343484
def check_next_match(self, match, new_relations, subject_graph, one_match):
        """"""
        if not CustomPattern.check_next_match(self, match, new_relations, subject_graph, one_match):
            return False
        if self.strong:
            # can this ever become a strong ring?
            vertex1_start = match.forward[self.pattern_graph.central_vertex]
            for vertex1 in new_relations.values():
                paths = list(subject_graph.iter_shortest_paths(vertex1, vertex1_start))
                if self.size % 2 == 0 and len(match) == self.size:
                    if len(paths) != 2:
                        #print "NRingPattern.check_next_match: not strong a.1"
                        return False
                    for path in paths:
                        if len(path) != len(match)//2+1:
                            #print "NRingPattern.check_next_match: not strong a.2"
                            return False
                else:
                    if len(paths) != 1:
                        #print "NRingPattern.check_next_match: not strong b.1"
                        return False
                    if len(paths[0]) != (len(match)+1)//2:
                        #print "NRingPattern.check_next_match: not strong b.2"
                        return False
            #print "RingPattern.check_next_match: no remarks"
        return True