; Root ends at first &#47; or \ after the first two characters.
      rootEnd = path.indexOf(new RegExp(r&#39;[&#47;\\]&#39;), 2);
      if (rootEnd == -1) return path;
    } else if (path.startsWith(&#39;\\&#39;) || path.startsWith(&#39;&#47;&#39;)) {
      rootEnd = 0;
    }
  } else if (path.startsWith(&#39;&#47;&#39;)) {
    rootEnd = 0;
  }
  &#47;&#47; Ignore trailing slashes.
  &#47;&#47; All non-trivial cases have separators between two non-separators.
  int pos = path.lastIndexOf(_parentRegExp);
  