Regex: Difference between revisions

Line 6:
== Metacharacters ==
 
{| class="wikitable"
{|
|-
|! Metacharacters Defined ||!! Metacharacter Examples
|-
| MChar || Definition || Pattern || Sample Matches
Line 23 ⟶ 24:
| [...] || Explicit set of characters to match. || a[bB]c || abc, aBc
|-
| (...) || Logical grouping of part of an expression. || (abc){2} || abcabc
|-
| * || 0 or more of previous expression. || ab*c || ac, abc, abbc, abbbc, ...
|-
| + || 1 or more of previous expression. || ab+c || abc, abbc, abbbc, ...
|-
| ? || 0 or 1 of previous expression; also forces minimal matching when an expression might match several strings within a search string. || ab?c || ac, abc
|-
| \ || Preceding one of the above, it makes it a literal instead of a special character. Preceding a special matching character, see below. || a\sc || a c
|}
 
== Character Escapes ==