Regex: Difference between revisions
Content added Content deleted
Line 8: | Line 8: | ||
{| class="wikitable" |
{| class="wikitable" |
||
|- |
|- |
||
! Metacharacters Defined !! Metacharacter Examples |
!colspan=2| Metacharacters Defined !!colspan=2| Metacharacter Examples |
||
|- |
|- |
||
! MChar !! Definition !! Pattern !! Sample Matches |
|||
|- |
|- |
||
| ^ || Start of a string. || ^abc || abc, abcdefg, abc123, ... |
| ^ || Start of a string. || ^abc || abc, abcdefg, abc123, ... |
||
Line 18: | Line 18: | ||
| . || Any character (except \n newline) || a.c || abc, aac, acc, adc, aec, ... |
| . || Any character (except \n newline) || a.c || abc, aac, acc, adc, aec, ... |
||
|- |
|- |
||
| | || Alternation. || bill|ted || ted, bill |
| <nowiki>|</nowiki> || Alternation. || <nowiki>bill|ted</nowiki> || ted, bill |
||
|- |
|- |
||
| {...} || Explicit quantifier notation. || ab{2}c || abbc |
| {...} || Explicit quantifier notation. || ab{2}c || abbc |