public static CustomUriRequest Parse([NotNull] string uri) {
if (!uri.StartsWith(CustomUriSchemeHelper.UriScheme, StringComparison.OrdinalIgnoreCase)) {
throw new Exception(ToolsStrings.Common_InvalidFormat);
}
var s = uri.SubstringExt(CustomUriSchemeHelper.UriScheme.Length);
var m = Regex.Match(s, @"^/((?:/[\w\.-]+)+)/?([?&][^#]*)?(?:#(.*))?");
if (!m.Success) {
throw new Exception(ToolsStrings.Common_InvalidFormat);
}
return new CustomUriRequest {
Path = m.Groups[1].Value.Substring(1),
Params = HttpUtility.ParseQueryString(m.Groups[2].Value),
Hash = m.Groups[3].Value
};
}