Metacharacters Defined | MChar | Definition | ^ | Start of a string. | $ | End of a string. | . | Any character (except \n newline) | | | Alternation. | {...} | Explicit quantifier notation. | [...] | Explicit set of characters to match. | (...) | Logical grouping of part of an expression. | * | 0 or more of previous expression. | + | 1 or more of previous expression. | ? | 0 or 1 of previous expression; also forces minimal matching when an expression might match several strings within a search string. | \ | Preceding one of the above, it makes it a literal instead of a special character. Preceding a special matching character, see below. | | Metacharacter Examples | Pattern | Sample Matches | ^abc | abc, abcdefg, abc123, ... | abc$ | abc, endsinabc, 123abc, ... | a.c | abc, aac, acc, adc, aec, ... | bill|ted | ted, bill | ab{2}c | abbc | a[bB]c | abc, aBc | (abc){2} | abcabc | ab*c | ac, abc, abbc, abbbc, ... | ab+c | abc, abbc, abbbc, ... | ab?c | ac, abc | a\sc | a c | |