Module: PathRegexes

Included in:
TopinambourRegex
Defined in:
lib/terminal_regex.rb

Constant Summary collapse

PATHCHARS_CLASS =

Omit the parentheses

"[-[:alnum:]\\Q_$.+!*,:;@&=?/~#|%\\E]"
PATHTERM_CLASS =

Chars to end a URL

"[-[:alnum:]\\Q_$+*:@&=/~#|%\\E]"
PATH_INNER_DEF =

Recursive definition of PATH that allows parentheses and square brackets only if balanced, see bug 763980.

"(?(DEFINE)(?<PATH_INNER>(?x: (?: #{PATHCHARS_CLASS}* (?: \\( (?&PATH_INNER) \\) | \\[ (?&PATH_INNER) \\] ) )* #{PATHCHARS_CLASS}* )))"
PATH_DEF =

“(?(DEFINE)(?<PATH_INNER>(?x: (?: ” PATHCHARS_CLASS“* \( (?&PATH_INNER) \) )* ” PATHCHARS_CLASS “* )))” Same as above, but the last character (if exists and is not a parenthesis) must be from PATHTERM_CLASS.

"(?(DEFINE)(?<PATH>(?x: (?: #{PATHCHARS_CLASS}* (?: \\( (?&PATH_INNER) \\) | \\[ (?&PATH_INNER) \\] ) )* (?: #{PATHCHARS_CLASS}* #{PATHTERM_CLASS} )? )))"
URLPATH =
"(?x: /(?&PATH) )?"
VOIP_PATH =
"(?x: [;?](?&PATH) )?"