match url determines if this is selected
339779
def match_url(self, request):
        
        matched = False
        if self.exact_url:
            if re.match("%s$" % (self.url,), request.path):
                matched = True
        elif re.match("%s" % self.url, request.path):
            matched = True
        return matched
217683
function matches(node, query) {
  return (node.matches =
    node.matchesSelector ||
    node.mozMatchesSelector ||
    node.msMatchesSelector ||
    node.oMatchesSelector ||
    node.webkitMatchesSelector ||
    function(s) {
      const matches = (this.document || this.ownerDocument).querySelectorAll(s);
      let i = matches.length;
      while (--i >= 0 && matches.item(i) !== this) {}
      return i > -1;
    }).call(node, query);
}
936849
def match(self, selector, index):
        """"""

        pseudo = None
        m = self.re_pseudo_name.match(selector, index)
        if m:
            name = util.lower(css_unescape(m.group('name')))
            pattern = self.patterns.get(name)
            if pattern:
                pseudo = pattern.match(selector, index)
                if pseudo:
                    self.matched_name = pattern

        return pseudo
765434
public final static boolean isValidURL(String url) {
        if (url == null) {
            return false;
        } else {
            return Patterns.WEB_URL.matcher(url).matches();
        }
    }
1115707
function searchBar_checkSearchResultPage(searchTerm) {
    // Retrieve the URL which is used for the currently selected search engine
    var targetUrl = this._bss.currentEngine.getSubmission(searchTerm, null).uri;
    var currentUrl = this._controller.tabs.activeTabWindow.document.location.href;

    // Check if pure domain names are identical
    var domainName = targetUrl.host.replace(/.+\.(\w+)\.\w+$/gi, "$1");
    var index = currentUrl.indexOf(domainName);

    this._controller.assertJS("subject.URLContainsDomain == true",
                              {URLContainsDomain: currentUrl.indexOf(domainName) != -1});

    // Check if search term is listed in URL
    this._controller.assertJS("subject.URLContainsText == true",
                              {URLContainsText: currentUrl.toLowerCase().indexOf(searchTerm.toLowerCase()) != -1});
  }
853839
public function isSelected()
  {
    if (Navigation::clearQueryArg(Request::getArgumentValue('q')) == Navigation::clearQueryArg($this->urlCode)) {
      return true;
    }
    return false;
  }
1031223
function match(re) {
    var m = re.exec(css);
    if (!m) return;
    var str = m[0];
    updatePosition(str);
    css = css.slice(str.length);
    return m;
  }
469172
def selected(self, request, tag):
        
        if self.option.selected:
            tag(selected='selected')
        return tag
5508
function Match(self, shift) {
  var start = self.__index__,
      end   = self.__last_index__,
      text  = self.__text_cache__.slice(start, end);

  /**
   * Match#schema -> String
   *
   * Prefix (protocol) for matched string.
   **/
  this.schema    = self.__schema__.toLowerCase();
  /**
   * Match#index -> Number
   *
   * First position of matched string.
   **/
  this.index     = start + shift;
  /**
   * Match#lastIndex -> Number
   *
   * Next position after matched string.
   **/
  this.lastIndex = end + shift;
  /**
   * Match#raw -> String
   *
   * Matched string.
   **/
  this.raw       = text;
  /**
   * Match#text -> String
   *
   * Notmalized text of matched string.
   **/
  this.text      = text;
  /**
   * Match#url -> String
   *
   * Normalized url of matched string.
   **/
  this.url       = text;
}
1313342
def validate_url(cls, url: str) -> Optional[Match[str]]:
        """"""
        match = re.match(cls._VALID_URL, url)
        return match
1103968
function current_word_is_url(tagged_sentence, i, parameter) {
              var is_url = false;
              if (tagged_sentence[i][0].indexOf(".") > -1) {
                // url if there are two contiguous alpha characters
                if (/[a-zA-Z]{2}/.test(tagged_sentence[i][0])) {
                  is_url = true;
                }
              }
              return((parameter === "YES") ? is_url : !is_url);
            }
470052
function isExactDomainMatch(part: string, debuggeeHost: string): boolean {
  return part.startsWith("www.")
    ? part.substr("www.".length) === debuggeeHost
    : part === debuggeeHost;
}
1266686
function checkUrl(){
    var newPath = location.hash.substr(1) || '';

    if (newPath != currentPath)
    {
      // check for recursion
      if (preventRecursion(newPath))
        return;

      // save current path
      currentPath = newPath;

      var routesToLeave = [];
      var routesToEnter = [];
      var routesToMatch = [];

      allRoutes.forEach(function(route){
        var flags = route.processLocation_(newPath);

        if (flags & ROUTE_LEAVE)
          routesToLeave.push(route);
        if (flags & ROUTE_ENTER)
          routesToEnter.push(route);
        if (flags & ROUTE_MATCH)
          routesToMatch.push(route);
      });

      for (var i = 0; i < routesToLeave.length; i++)
        routeLeave(routesToLeave[i]);

      for (var i = 0; i < routesToEnter.length; i++)
        routeEnter(routesToEnter[i]);

      for (var i = 0; i < routesToMatch.length; i++)
        routeMatch(routesToMatch[i]);

      /** @cut */ flushLog(namespace + ': hash changed to "' + newPath + '"');
    }
    else
    {
      allRoutes.forEach(function(route){
        if (route.value)
        {
          routeEnter(route, true);
          routeMatch(route, true);
        }
      });

      /** @cut */ flushLog(namespace + ': checkUrl()');
    }
  }
685676
def is_url(value):
    ""
    if not isinstance(value, str):
        return False
    if not value.startswith('http://') and not value.startswith('https://'):
        return False
    # Any whitespace at all is invalid
    if whitespace_re.search(value):
        return False
    return True
127589
function matches (el, selector) {
  var _matches = el.matches ||
    el.matchesSelector ||
    el.msMatchesSelector ||
    el.mozMatchesSelector ||
    el.webkitMatchesSelector ||
    el.oMatchesSelector

  if (_matches) {
    return _matches.call(el, selector)
  } else if (el.parentNode) {
    // IE8 and below
    var nodes = el.parentNode.querySelectorAll(selector)
    for (var i = nodes.length; i--; 0) {
      if (nodes[i] === el) return true
    }
    return false
  }
}
644138
function(url) {
            if (url == null) return this;
            if (url.length > 0 && url[0] == "/") {
                url = url.replace("/", "");
            }
            var matched = _.any(this.handlers, function(handler) {
                if (handler.route.test(url)) {
                    handler.callback(url);
                    return true;
                }
                return false;
            });
            logging.log("handle state ", url, matched != null);
            return matched;
        }
779696
function elementMatches (el, selector) {
  if (el.matches) { return el.matches(selector) }
  if (el.msMatchesSelector) { return el.msMatchesSelector(selector) }
  if (el.webkitMatchesSelector) { return el.webkitMatchesSelector(selector) }
}