This method derives the regular expression from the supplied
URI.

@param endpoint The endpoint
@param meta Whether this is a meta endpoint
@return The regular expression
966546
protected static String createRegex(String endpoint, boolean meta) {
        StringBuilder regex = new StringBuilder();

        regex.append('^');

        for (int i=0; i < endpoint.length(); i++) {
            char ch=endpoint.charAt(i);
            if ("*".indexOf(ch) != -1) {
                regex.append('.');
            } else if ("\\.^$|?+[]{}()".indexOf(ch) != -1) {
                regex.append('\\');
            }
            regex.append(ch);
        }

        regex.append('$');

        return regex.toString();
    }
1237060
public static V1BinaryAnnotation createAddress(String address, Endpoint endpoint) {
    if (endpoint == null) throw new NullPointerException("endpoint == null");
    return new V1BinaryAnnotation(address, null, endpoint);
  }
920199
private function getEndpoint(string $endpoint) : string
    {
        return sprintf(
            '%s/%s/%s',
            $this->config->get('serverUrl'),
            $this->config->get('apmVersion'),
            $endpoint
        );
    }
632738
public Object getValue(String parameter, Endpoint endpoint){
        return endpoint.getEndpointConfiguration().getParameter(parameter);
        
    }
1081161
public static Endpoint determineEndpointForRequest(final RequestAbstractType authnRequest,
                                                       final SamlRegisteredServiceServiceProviderMetadataFacade adaptor,
                                                       final String binding) {
        var endpoint = (Endpoint) null;
        if (authnRequest instanceof LogoutRequest) {
            endpoint = adaptor.getSingleLogoutService(binding);
        } else {
            val endpointReq = getAssertionConsumerServiceFromRequest(authnRequest, binding);
            endpoint = endpointReq == null
                ? adaptor.getAssertionConsumerService(binding)
                : endpointReq;
        }

        if (endpoint == null || StringUtils.isBlank(endpoint.getBinding())) {
            throw new SamlException("Assertion consumer service does not define a binding");
        }
        val location = StringUtils.isBlank(endpoint.getResponseLocation()) ? endpoint.getLocation() : endpoint.getResponseLocation();
        if (StringUtils.isBlank(location)) {
            throw new SamlException("Assertion consumer service does not define a target location");
        }
        return endpoint;
    }
1359081
function findMetaTag(attribute, regExp = /.*/) {
  let metas = document.querySelectorAll(`meta[${attribute}]`);
  for (let i = 0; i < metas.length; i++) {
    let match = metas[i].getAttribute(attribute).match(regExp);
    if (match) {
      return metas[i];
    }
  }
  return null;
}
704992
public synchronized void setEndpoint(URI endpoint) {
        checkUpdatable();
        int port = endpoint.getPort();
        if (port==80||port==443) {
            if (MwsUtl.usesStandardPort(endpoint)) {
                try {
                    //some versions of apache http client cause signature errors when
                    //standard port is explicitly used, so remove that case.
                    endpoint = new URI(endpoint.getScheme(), endpoint.getHost(), 
                            endpoint.getPath(), endpoint.getFragment());
                } catch (URISyntaxException e) {
                    throw new IllegalArgumentException(e);
                }
            }
        }
        this.endpoint = endpoint;
    }
660418
private synchronized String getMatchingURI(String incomingURI) {
        String[] incomingURIParts = incomingURI.split("/");

        ArrayList<String[]> tockenizedEndpoints = new ArrayList<String[]>();
        for (String endpointURI : serverEndpointConfigMap.keySet()) {
            // Since the endpoint paths are either relative URIs or URI templates level 1, the paths do not match if they 
            // do not have the same number of segments, using ’/’ as the separator.
            if (incomingURIParts.length == endpointURI.split("/").length) {
                tockenizedEndpoints.add(endpointURI.split("/"));
            }
        }

        /**
         * For each segment of the incoming uri, compare the corresponding segment of every endpoint uri. If matched (exact match or variable {} match)
         * add that endpoint to the list of matchedURI. Move to next segment of the incoming uri and do the same match. At the end of this loop
         * we have list of possible matched endpoints for the incoming URI
         * For e.g if the incoming uri = a/b/d and endpoints are /{var}/b/d, /a/x/y, {var}/b/{var}, /a/{var}/{var}, /{var}/{var}/{var} then
         * possible matchedURIs are /{var}/b/d, {var}/b/{var}, /a/{var}/{var}, /{var}/{var}/{var}
         */
        for (int i = 1; i < incomingURIParts.length; i++) { // start with i=1 skipping the first part because first part of split("/") for /../../.. is always an empty string 
            ArrayList<String[]> matchedURIs = new ArrayList<String[]>();
            // for a each segment in incomingURI, check the corresponding segment of every endpoint.
            for (int j = 0; j < tockenizedEndpoints.size(); j++) {
                String[] tockens = tockenizedEndpoints.get(j);
                if (incomingURIParts[i].equals(tockens[i])) {
                    matchedURIs.add(tockenizedEndpoints.get(j));
                }
                if (tockens[i].startsWith("{") && (tockens[i].endsWith("}"))) {
                    matchedURIs.add(tockenizedEndpoints.get(j));
                }
            }
            tockenizedEndpoints.clear();
            tockenizedEndpoints.addAll(matchedURIs);
        }

        //sort matched endpoints in order of preference from left to right for exact match at each segment giving a higher precedence 
        if (tockenizedEndpoints.size() > 1) {
            Collections.sort(tockenizedEndpoints, COMPARATOR);
        }

        String[] tockenizedEndpoint = null;
        if (!tockenizedEndpoints.isEmpty()) {
            tockenizedEndpoint = tockenizedEndpoints.get(0); //best match is always the top element in the sorted list
        }

        if (tockenizedEndpoint != null) {
            return unTockenizeEp(tockenizedEndpoint);
        } else {
            return null;
        }
    }
711290
public EndpointInfoBuilder regexPathPrefix(String regexPathPrefix) {
        requireNonNull(regexPathPrefix, "regexPathPrefix");
        checkState(fragment == null, "regexPathPrefix cannot be set with fragment: %s", fragment);
        this.regexPathPrefix = regexPathPrefix;
        return this;
    }
23390
public static String decodeEndpointURI(String endpoint) {
        int ind=endpoint.indexOf('[');
        if (ind == 0) {
            return null;
        } else if (ind != -1) {
            return endpoint.substring(0, ind);
        }
        return endpoint;
    }
533213
public static URI toUri(String endpoint, Protocol protocol) {
        if (endpoint == null) {
            throw new IllegalArgumentException("endpoint cannot be null");
        }

        /*
         * If the endpoint doesn't explicitly specify a protocol to use, then
         * we'll defer to the default protocol specified in the client
         * configuration.
         */
        if (!endpoint.contains("://")) {
            endpoint = protocol.toString() + "://" + endpoint;
        }

        try {
            return new URI(endpoint);
        } catch (URISyntaxException e) {
            throw new IllegalArgumentException(e);
        }
    }
561570
private String getURL(String endpoint, int version, String method) {
        StringBuilder sb = new StringBuilder();
        sb.append(endpoint);
        if (!endpoint.endsWith(FORWARD_SLASH)) {
            sb.append(FORWARD_SLASH);
        }
        sb.append(VERSION_PREFIX + version + FORWARD_SLASH + method);
        return sb.toString();
    }
1068478
public static <I extends Request, O extends Response>
    CompositeServiceEntry<I, O> ofRegex(Pattern regex, Service<I, O> service) {
        return new CompositeServiceEntry<>(PathMapping.ofRegex(regex), service);
    }
539016
private static String getHost(final String endpoint) {
        String host = URI.create(endpoint).getHost();
        if (host == null) {
            host = URI.create("http://" + endpoint).getHost();
        }
        return host;
    }
339050
private function validateEndpoint($endpoint)
    {
        $isValid = filter_var($endpoint, FILTER_VALIDATE_URL);

        if ($isValid) {
            $scheme = strtolower(parse_url($endpoint, PHP_URL_SCHEME));
            if (in_array($scheme, ['http', 'https'], true)) {
                return;
            }
        }

        throw new Exception(self::ERR_INVALID_ENDPOINT);
    }
807548
public static String encodeMetadata(ServiceEndpoint serviceEndpoint) {
    try {
      return objectMapper.writeValueAsString(serviceEndpoint);
    } catch (IOException e) {
      LOGGER.error("Failed to write metadata: " + e);
      throw Exceptions.propagate(e);
    }
  }
1151153
private void handleEndpointMatch(OngoingRequest request, RuleMatch<Endpoint> match) {
    final Endpoint endpoint = match.getRule().getTarget();
    final Map<String, String> parsedPathArguments = match.parsedPathArguments();
    final Client requestScopedClient = client.wrapRequest(request.request());
    final RequestContext requestContext =
        RequestContexts.create(request.request(),
                               requestScopedClient,
                               parsedPathArguments,
                               request.arrivalTimeNanos(),
                               request.metadata());

    erf.create(request, requestContext, endpoint)
        .run();
  }