Split into static segments separated by path parameter placeholders. The number of segments is always 1 more than the number of parameters.
181361
function matchDetails(m, isSearch) {
    var id, regexp, segment, type, cfg, arrayMode;
    id          = m[2] || m[3]; // IE[78] returns '' for unmatched groups instead of null
    cfg         = config.params[id];
    segment     = pattern.substring(last, m.index);
    regexp      = isSearch ? m[4] : m[4] || (m[1] == '*' ? '.*' : null);

    if (regexp) {
      type      = $$UMFP.type(regexp) || inherit($$UMFP.type("string"), { pattern: new RegExp(regexp, config.caseInsensitive ? 'i' : undefined) });
    }

    return {
      id: id, regexp: regexp, segment: segment, type: type, cfg: cfg
    };
  }
558143
static String[] getPathNames(String path) {
    if (path == null || !path.startsWith(Path.SEPARATOR)) {
      return null;
    }
    return StringUtils.split(path, Path.SEPARATOR_CHAR);
  }
864704
function _removeDotSegments(path, hasAuthority) {
  var rval = '';

  if(path.indexOf('/') === 0) {
    rval = '/';
  }

  // RFC 3986 5.2.4 (reworked)
  var input = path.split('/');
  var output = [];
  while(input.length > 0) {
    if(input[0] === '.' || (input[0] === '' && input.length > 1)) {
      input.shift();
      continue;
    }
    if(input[0] === '..') {
      input.shift();
      if(hasAuthority ||
        (output.length > 0 && output[output.length - 1] !== '..')) {
        output.pop();
      }
      // leading relative URL '..'
      else {
        output.push('..');
      }
      continue;
    }
    output.push(input.shift());
  }

  return rval + output.join('/');
}
687403
def process_path_part(part, parameters):
    
    if PARAMETER_REGEX.match(part):
        parameter_name = part.strip('{}')
        try:
            parameter = find_parameter(
                parameters,
                name=parameter_name,
                in_=PATH
            )
        except ValueError:
            pass
        else:
            return construct_parameter_pattern(parameter)
    return escape_regex_special_chars(part)
1304236
def path_segment(self, index, value=None, default=None):
        
        if value is not None:
            segments = list(self.path_segments())
            segments[index] = unicode_quote_path_segment(value)
            new_path = '/' + '/'.join(segments)
            if self._tuple.path.endswith('/'):
                new_path += '/'
            return URL._mutate(self, path=new_path)
        try:
            return self.path_segments()[index]
        except IndexError:
            return default
869185
function normalizePath(path)
{
    if (path.indexOf("..") === -1 && path.indexOf('.') === -1)
        return path;

    var normalizedSegments = [];
    var segments = path.split("/");
    for (var i = 0; i < segments.length; i++) {
        var segment = segments[i];
        if (segment === ".")
            continue;
        else if (segment === "..")
            normalizedSegments.pop();
        else if (segment)
            normalizedSegments.push(segment);
    }
    var normalizedPath = normalizedSegments.join("/");
    if (normalizedPath[normalizedPath.length - 1] === "/")
        return normalizedPath;
    if (path[0] === "/" && normalizedPath)
        normalizedPath = "/" + normalizedPath;
    if ((path[path.length - 1] === "/") || (segments[segments.length - 1] === ".") || (segments[segments.length - 1] === ".."))
        normalizedPath = normalizedPath + "/";

    return normalizedPath;
}
1130822
def JoinKeyPath(path_segments):
  
  # This is an optimized way to combine the path segments into a single path
  # and combine multiple successive path separators to one.

  # Split all the path segments based on the path (segment) separator.
  path_segments = [
      segment.split(definitions.KEY_PATH_SEPARATOR)
      for segment in path_segments]

  # Flatten the sublists into one list.
  path_segments = [
      element for sublist in path_segments for element in sublist]

  # Remove empty path segments.
  path_segments = filter(None, path_segments)

  key_path = definitions.KEY_PATH_SEPARATOR.join(path_segments)
  if not key_path.startswith('HKEY_'):
    key_path = '{0:s}{1:s}'.format(definitions.KEY_PATH_SEPARATOR, key_path)
  return key_path
378048
public static String parentPathString(String path) {
        String[] split = componentsFromPathString(path);
        if (split.length > 1) {
            StringBuilder stringBuilder = new StringBuilder();
            for (int i = 0; i < split.length - 1; i++) {
                if (i > 0) {
                    stringBuilder.append(SEPARATOR);
                }
                stringBuilder.append(split[i]);
            }
            return stringBuilder.toString();
        }
        return "";
    }
748463
function(fsPath, strict) {
		if (!_.isString(fsPath)) {
			throw new TypeError('path must be of type string');
		}
		var segments = _.filter(fsPath.substring(fsPath.indexOf(path.sep) + 1).split(path.sep), function(segment) {
			return segment !== '';
		});
		for (var i = 0; i < segments.length; i++) {
			var replaceWith = module.exports.reformatSegment(segments[i], strict);
			var find = util.format('%s%s', replaceWith === '' ? path.sep : '', segments[i]);
			fsPath = fsPath.replace(find, replaceWith);
		}
		return fsPath;
	}
723950
def _AddPathSegments(self, path, ignore_list):
    
    path_segments = path.split(self._path_segment_separator)
    for path_segment_index, path_segment in enumerate(path_segments):
      if path_segment_index not in self.path_segments_per_index:
        self.path_segments_per_index[path_segment_index] = {}

      if path_segment_index not in ignore_list:
        path_segments = self.path_segments_per_index[path_segment_index]

        if path_segment not in path_segments:
          path_segments[path_segment] = []

        paths_per_segment_list = path_segments[path_segment]
        paths_per_segment_list.append(path)
141942
def _JoinKeyPath(self, path_segments):
    
    # This is an optimized way to combine the path segments into a single path
    # and combine multiple successive path separators to one.

    # Split all the path segments based on the path (segment) separator.
    path_segments = [
        segment.split(definitions.KEY_PATH_SEPARATOR)
        for segment in path_segments]

    # Flatten the sublists into one list.
    path_segments = [
        element for sublist in path_segments for element in sublist]

    # Remove empty path segments.
    path_segments = filter(None, path_segments)

    return definitions.KEY_PATH_SEPARATOR.join(path_segments)
569615
function(parts) {
        var urls = [];
        var start = '';

        // If the first part is empty
        // the original path begins with a slash so we
        // do that, too

        if( _.isEmpty(parts[0]) ) {
            start = '/';
            urls[0] = '/';      // would not be generated in reduce()
        }

        _.reduce(parts, function(acc, value){

            if( ! _.isString(value) || _.isEmpty(value) )
                return acc;

            acc += value;

            // Push w/out trailing slash
            urls.push(acc);

            return acc + '/';
        }, start );

        return urls;
    }
747744
def join_url_parts(*args):
    
    # check for edge case
    if len(args) == 1:
        return args[0]

    return_val = clean_url_segment(args[0])

    for i in range(1, len(args)):
        arg = args[i]

        if i == len(args) - 1:
            # no need to remove a trailing slash if this is the last segment
            return_val += '/' + arg
        else:
            # remove a trailing slash so it won't be duplicated
            return_val += '/' + clean_url_segment(arg)

    return return_val
277230
function normalizePathParts(parts) {

        // IMPORTANT: It is assumed that parts[0] === "" because this method is used to
        // join an absolute path to a relative path
        var i;
        var len = 0;

        var numParts = parts.length;

        for (i = 0; i < numParts; i++) {
            var part = parts[i];

            if (part === '.') {
                // ignore parts with just "."
                /*
                // if the "." is at end of parts (e.g. ["a", "b", "."]) then trim it off
                if (i === numParts - 1) {
                    //len--;
                }
                */
            } else if (part === '..') {
                // overwrite the previous item by decrementing length
                len--;
            } else {
                // add this part to result and increment length
                parts[len] = part;
                len++;
            }
        }

        if (len === 1) {
            // if we end up with just one part that is empty string
            // (which can happen if input is ["", "."]) then return
            // string with just the leading slash
            return '/';
        } else if (len > 2) {
            // parts i s
            // ["", "a", ""]
            // ["", "a", "b", ""]
            if (parts[len - 1].length === 0) {
                // last part is an empty string which would result in trailing slash
                len--;
            }
        }

        // truncate parts to remove unused
        parts.length = len;
        return parts.join('/');
    }
548932
static String canonicalizePath(String path) {
    String[] parts = path.split(MODULE_SLASH);
    String[] buffer = new String[parts.length];
    int position = 0;
    int available = 0;

    boolean absolutePath = (parts.length > 1 && parts[0].isEmpty());
    if (absolutePath) {
      // If the path starts with "/" (so the left side, index zero, is empty), then the path will
      // always remain absolute. Make the first segment unavailable to touch.
      --available;
    }

    for (String part : parts) {
      if (part.equals(".")) {
        continue;
      }

      if (part.equals("..")) {
        if (available > 0) {
          // Consume the previous segment.
          --position;
          --available;
          buffer[position] = null;
        } else if (!absolutePath) {
          // If this is a relative path, retain "..", as it can't be consumed on the left.
          buffer[position] = part;
          ++position;
        }
        continue;
      }

      buffer[position] = part;
      ++position;
      ++available;
    }

    if (absolutePath && position == 1) {
      return MODULE_SLASH;  // special-case single absolute segment as joining [""] doesn't work
    }
    return MODULE_JOINER.join(Arrays.copyOf(buffer, position));
  }
908142
def split_path(path) :
    ""
    if isinstance(path, (tuple, list)) :
        result = path # assume already split
    elif path == "/" :
        result = []
    else :
        if not path.startswith("/") or path.endswith("/") :
            raise DBusError(DBUS.ERROR_INVALID_ARGS, "invalid path %s" % repr(path))
        #end if
        result = path.split("/")[1:]
    #end if
    return \
        result
1121910
function(uri) {
        var original_segments = window.location.pathname.split('/');
        var route_segments = uri.split('/');
        var route_length = route_segments.length;
        var params = {};
        for (var i = 1; i < route_length; i++) {
            if (route_segments[i].indexOf('{') !== -1) {
                var name = route_segments[i].substr(1, route_segments[i].length-2);
                params[name] = original_segments[i];
            }
        }
        return params;
    }