Get pattern for intern URL matching.

        @return non-empty regex pattern or None
        @rtype String or None
193016
def get_intern_pattern (self, url=None):
        
        if url is None:
            url = absolute_url(self.base_url, self.base_ref, self.parent_url)
        if not url:
            return None
        return get_intern_pattern(url)
1230281
public function getPattern() : ?string 
    {
        if ( ! $this->hasPattern()) {
            $this->setPattern($this->getDefaultPattern());
        }
        return $this->pattern;
    }
540858
function getTokenValuesFromUrl(pattern, url) {
    var tokenValues = {},
        urlSegments = url.split('/');

    pattern.split('/').forEach(function (segment, idx) {

        // this has this form {stuff}, so let's dig
        var beginIdx = segment.indexOf('{');
        var endIdx = segment.indexOf('}');
        var endLen = segment.length - endIdx - 1;
        var urlSegment = urlSegments[idx];

        if (beginIdx > -1) {

            // peel off the { and } at the ends
            segment = segment.substring(beginIdx + 1, endIdx);

            var pieces = segment.split(':');
            if (pieces.length === 2 && pieces[1] === urlPathPatternSymbol ) {
                var vals = [urlSegment.substring(beginIdx, urlSegment.length - endLen)];
                for ( var i = idx + 1, len = urlSegments.length; i < len; i++ ) {
                    vals.push(urlSegments[i]);
                }
                tokenValues[pieces[0]] = vals.join('%20'); // join any remaining segments with a space
            }
            else if (pieces.length === 2 || pieces.length === 1) {
                tokenValues[pieces[0]] = urlSegment.substring(beginIdx, urlSegment.length - endLen);
            }
        } // else no token to grab
    });

    return tokenValues;
}
1144910
public static List<Pattern> getNoProxyHostPatterns(String noProxyHost) {
        if (noProxyHost==null)  return Collections.emptyList();

        List<Pattern> r = Lists.newArrayList();
        for (String s : noProxyHost.split("[ \t\n,|]+")) {
            if (s.length()==0)  continue;
            r.add(Pattern.compile(s.replace(".", "\\.").replace("*", ".*")));
        }
        return r;
    }
952316
def urlmap(patterns):
    """"""
    for pattern in patterns:
        group = getattr(pattern, 'namespace', None)
        if group is None:
            group = getattr(pattern, 'app_name', None)
        path = '/' + get_pattern(pattern).lstrip('^').rstrip('$')
        if isinstance(pattern, PATTERNS):
            yield (group, pattern.name), path
        elif isinstance(pattern, RESOLVERS):
            subpatterns = pattern.url_patterns
            for (_, name), subpath in urlmap(subpatterns):
                yield (group, name), path.rstrip('/') + subpath
276042
function getFingerprintForURL(url) {
	var domain = getDomain(url);
	var found = global.requestSSLFingerprints[domain];
	debug('getFingerprintForURL %s -> %s=%s',url,domain,found);
	if (!found) {
		// try a wildcard search
		var u = urlib.parse(domain),
			tokens = (u && u.host || domain).split('.');
		domain = '*.'+tokens.splice(tokens.length > 1 ? 0 : 1).join('.');
		found = global.requestSSLFingerprints[domain];
		debug('getFingerprintForURL (wildcard) %s -> %s=%s',url,domain,found);
	}
	return found;
}
806034
function _getCompoundedRegex() {
            if ($this->_regex == null) {
                for ($i = 0; $i < count($this->_patterns); $i++) {
                    $this->_patterns[$i] = '(' . str_replace(
                            array('/', '(', ')'),
                            array('\/', '\(', '\)'),
                            $this->_patterns[$i]) . ')';
                }
                $this->_regex = "/" . implode("|", $this->_patterns) . "/" . $this->_getPerlMatchingFlags();
            }
            return $this->_regex;
        }
872776
protected String getMappingString() {
        StringBuilder sb = new StringBuilder();
        final int schemaSize = uriMap.size();
        final int domainSize = patternMap.size();
        int s = 0, d = 0;
        for (String schema: uriMap.keySet()) {
            if (s > 0) sb.append(", ");
            sb.append(schema);
            s++;
            if (s > 2 && schemaSize > 3) {
                sb.append(", ");
                sb.append(schemaSize - s);
                sb.append(" more");
                break;
            }
        }
        if (schemaSize > 0 && domainSize > 0) sb.append("; ");
        for (Pattern domain: patternMap.keySet()) {
            if (d > 0) sb.append(", ");
            sb.append(domain.pattern());
            d++;
            if (d > 2 && domainSize > 3) {
                sb.append(", ");
                sb.append(domainSize - s);
                sb.append(" more");
                break;
            }
        }
        return sb.toString();
    }
1357338
public static String getRootRelativePath(String url) {

		Matcher matcher = URL_SEPARATOR_PATTERN.matcher(url);
		StringBuffer result = new StringBuffer();
		boolean first = true;
		while (matcher.find()) {
			if (first) {
				matcher.appendReplacement(result, "");
				first = false;
			} else {
				matcher.appendReplacement(result, ROOT_REPLACE_PATTERN);
			}
		}

		return result.toString();
	}
407603
private BasicUrl findUrl(TextCursor cursor, int limit) {
        for (int i = cursor.currentOffset; i < limit; i++) {
            if (!isGoodAnchor(cursor.text, i - 1)) {
                continue;
            }
            String currentText = cursor.text.substring(i, limit);
            MatcherCompat matcher = Patterns.WEB_URL_START.matcher(currentText);
            if (matcher.hasMatch()) {
                String url = matcher.group();
                int start = i + matcher.start();
                return new BasicUrl(start, start + url.length());
            }
        }
        return null;
    }
135972
protected String getQueryString() {
        if (bindings.size() == 0)
            return queryString;
        String qry = queryString;
        int b = qry.indexOf('{');
        String select = qry.substring(0, b);
        String where = qry.substring(b);
        for (String name : bindings.getBindingNames()) {
            String replacement = getReplacement(bindings.getValue(name));
            if (replacement != null) {
                String pattern = "[\\?\\$]" + name + "(?=\\W)";
                select = select.replaceAll(pattern, "");
                where = where.replaceAll(pattern, replacement);
            }
        }
        return select + where;
    }
940449
public Optional<String> getPattern() {
        if (property instanceof StringProperty) {
            StringProperty stringProperty = (StringProperty) property;
            return Optional.ofNullable(stringProperty.getPattern());
        } else if (property instanceof UUIDProperty) {
            UUIDProperty uuidProperty = (UUIDProperty) property;
            return Optional.ofNullable(uuidProperty.getPattern());
        }
        return Optional.empty();
    }
1316751
private String matchPatternInBuffer(Pattern pattern) {
        matchValid = false;
        matcher.usePattern(pattern);
        matcher.region(position, buf.limit());
        if (matcher.lookingAt()) {
            if (matcher.hitEnd() && (!sourceClosed)) {
                // Get more input and try again
                needInput = true;
                return null;
            }
            position = matcher.end();
            return matcher.group();
        }

        if (sourceClosed)
            return null;

        // Read more to find pattern
        needInput = true;
        return null;
    }
1316844
public String getUrl() {
		Environment env = getEnvironment();
		Map<String, String> parameters = env.getHiddenParameters();
		parameters.put(WWINDOW_REQUEST_PARAM_KEY, getId());
		// Override the step count with WWindow step
		parameters.put(Environment.STEP_VARIABLE, String.valueOf(getStep()));

		String url = env.getWServletPath();

		return WebUtilities.getPath(url, parameters, true);
	}
163518
String getPattern() {
        final StringBuilder result = new StringBuilder();

        if (myPrefix != null) {
            result.append(myPrefix);
        }
        if (mySuffixes != null) {
            result.append("*");
            for (final Literal sub : mySuffixes) {
                result.append(sub);
                result.append("*");
            }
        }
        if (myPostfix != null) {
            result.append(myPostfix);
        }
        return result.toString();
    }
778473
public String getSanitizedUrl() {
        if (url.startsWith("http://") && (url.endsWith(":80") || url.contains(":80/"))) {
            return url.replaceAll("\\?.*", "").replaceAll(":80", "");
        } else if (url.startsWith("https://") && (url.endsWith(":443") || url.contains(":443/"))) {
            return url.replaceAll("\\?.*", "").replaceAll(":443", "");
        } else {
            return url.replaceAll("\\?.*", "");
        }
    }
230502
private URL getUrl() {
        ClassLoader loader = null;
        try {
            loader = Thread.currentThread().getContextClassLoader();
        } catch (Exception e) {
            // do nothing
        }

        if (loader == null) {
            loader = ClassPathResource.class.getClassLoader();
        }

        URL url = loader.getResource(this.resourceName);
        if (url == null) {
            // try to check for mis-used starting slash
            // TODO: see TODO below
            if (this.resourceName.startsWith("/")) {
                url = loader.getResource(this.resourceName.replaceFirst("[\\\\/]", ""));
                if (url != null)
                    return url;
            } else {
                // try to add slash, to make clear it's not an issue
                // TODO: change this mechanic to actual path purifier
                url = loader.getResource("/" + this.resourceName);
                if (url != null)
                    return url;
            }
            throw new IllegalStateException("Resource '" + this.resourceName + "' cannot be found.");
        }
        return url;
    }