Template:RegexEscape/doc
Jump to navigation
Jump to search
Usage
{{RegexEscape}}
is a template that escaped characters normally used in Regex statements
Syntax
{{RegexEscape|SomeKindOfInput}}
Characters | Description |
---|---|
[]
|
Square brackets are Regex characters for matching any character specified within the brackets. [abqr] would match an a , b , q , or r .
|
{}
|
Curly brackets are Regex characters for matching ranges. a{4,} would match 4 or more "a" characters. b{3,8} would match between 3 and 8 "b" characters.
|
()
|
Parentheses are Regex characters for capturing groups of characters. |
.
|
The period is a Regex character that indicates "Any character". |
-
|
The hyphen character is a Regex character that indicates ranges. [0-9] would match any number between 0 and 9, 5-8 would match any number between 5 and 8.
|
^
|
The super character is a Regex character that indicates the start of the line. |
$
|
The dollar sign is a Regex character that indicates the end of the line. til$ would match until but not tiles .
|
Examples
{{RegexEscape|It's a (Quest)}}
|
It's a \(Quest\) |
{{RegexEscape|^Normal Regex$}}
|
\^Normal Regex\$ |