Loading...
Loading...
Anchors, character classes, quantifiers, groups, and lookarounds with real examples for emails, URLs, dates, and more.
^$\b\B.\d\D\w\W\s\S[abc][^abc][a-z]*+?{n}{n,}{n,m}*?, +?, ??(abc)(?:abc)(?<name>abc)a|b\1, \2(?=abc)(?!abc)(?<=abc)(?<!abc)/.../i/.../g/.../m/.../s/.../u^[\w.+-]+@[\w-]+\.[\w.-]+$Use a real validator for production this is the 90% case.
^https?:\/\/[\w.-]+\.[a-z]{2,}(?:\/[^\s]*)?$Matches http(s) URLs with optional path.
^\d{4}-\d{2}-\d{2}$YYYY-MM-DD.
^#(?:[0-9a-fA-F]{3}){1,2}$Three or six hex digits.
^(\d{1,3}\.){3}\d{1,3}$Loose. Tighten with range checks if needed.
^\+?[1-9]\d{6,14}$Optional + followed by 7-15 digits.
^[a-z0-9]+(?:-[a-z0-9]+)*$Lowercase, dash-separated, no leading/trailing dash.
^\s+|\s+$Use with /g to remove leading and trailing whitespace.
We turn AI cheatsheets into production code. Tell us what you're building.