Valid email (RFC5322)
(3 <= len <= 16, leters, numbers, or dashes)
Minimum length of 6, at least one uppercase letter, at least one lowercase letter, at least one number, at least one special character
URL (http, https or ftp)
Cannot verify name like www…example.com. will check later
SSN - Social Security Nubmer
Alpha-numeric, literals, digits, lowercase, uppercase chars only
\w //alpha-numeric only [a-zA-Z] //literals only \d //digits only [a-z] //lowercase literal only [A-Z] //uppercase literal only
Other useful topics:
- Boundaries — \b and \B
- Back-references — \1
\1it matches the same text that was matched by the first capturing group -> Try it!
we can use
\4, etc.) to identify the same text that was matched by the second (third, fourth, etc.) capturing group -> Try it!
we put the name foo to the group and we reference it later (
\k<foo>). The result is the same of the first regex -> Try it!
- Look-ahead and Look-behind — (?=) and (?<=)
donly if is followed by
rwill not be part of the overall regex match -> Try it!
donly if is preceded by an
rwill not be part of the overall regex match -> Try it!](https://regex101.com/r/cO8lqs/19)