Regex: Difference between revisions

Line 6:
== Metacharacters ==
 
{| class="wikitable" style="width:80%"
|-
!colspan=2| Metacharacters Defined !!colspan=2| Metacharacter Examples
|-
! MChar !! Definition !! style="width:15%"|Pattern !!style="width:25%"| Sample Matches
|-
| ^ || Start of a string. || ^abc || abc, abcdefg, abc123, ...
Line 30:
| + || 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 <br />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. <br />Preceding a special matching character, see below. || a\sc || a c
|}