Regular Expression Reference
Regular Expression Reference
1) Write a regular expression to match pattern in email.
e.g match -eu before @ in email.
Regex : /.*-eu@gmail.com/g
2) Meta Character Reference
Meta Char | Definition | Pattern | Sample Matches |
^ | Start of a string. | ^abc | abc, abcdefg, abc123, ... |
$ | End of a string. | abc$ | abc, endsinabc, 123abc, ... |
| | Alternation. | bill|ted | ted, bill |
{...} | Explicit quantifier notation. | ab{2}c | abbc |
[...] | 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 |
(Visited 72 times, 1 visits today)