Email Address
Matches most common email address formats for basic input filtering.
Use this for a lightweight format check, not proof that an address exists or can receive mail.
Find
[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}Test, explain and share JavaScript regular expressions with live highlighting, then start from a practical pattern below. Every recipe lists its gotchas so you know when not to use it.
Tip Hover or place the caret in the expression or the text to inspect tokens and matches.
[\w.+-]+ Repeats the previous token. Matches as many repetitions as possible, then backtracks.[\w.+-] Matches any one character in the set.\w Matches A–Z, a–z, 0–9 or underscore.. Matches "." (U+002E).+ Matches "+" (U+002B).- Matches "-" (U+002D).@ Matches "@" (U+0040).[\w-]+ Repeats the previous token. Matches as many repetitions as possible, then backtracks.[\w-] Matches any one character in the set.\w Matches A–Z, a–z, 0–9 or underscore.- Matches "-" (U+002D).(?:\.[\w-]+)* Repeats the previous token. Matches as many repetitions as possible, then backtracks.(?:\.[\w-]+) Groups tokens without creating a capture.\. Matches "." (U+002E).[\w-]+ Repeats the previous token. Matches as many repetitions as possible, then backtracks.[\w-] Matches any one character in the set.\w Matches A–Z, a–z, 0–9 or underscore.- Matches "-" (U+002D).\. Matches "." (U+002E).[a-z]{2,} Repeats the previous token. Matches as many repetitions as possible, then backtracks.[a-z] Matches any one character in the set.a-z Matches any character between the two code points, inclusive. (U+0061–U+007A). Case-insensitive.Practical regular expressions and find-and-replace recipes, shared with the site-wide reference data. Open any of them in the sandbox above.
Showing 8 of 8 patterns. Search and filters are shareable by URL.
Matches most common email address formats for basic input filtering.
Use this for a lightweight format check, not proof that an address exists or can receive mail.
Find
[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}Matches standard HTTP and HTTPS URLs in common text.
Useful for finding likely web URLs in text; use a URL parser when you need semantic validation.
Find
https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)Matches a date in YYYY-MM-DD format.
Use this for the basic shape of an ISO calendar date, then parse it to verify that the day exists.
Find
^\d{4}-\d{2}-\d{2}$Finds runs of non-alphanumeric characters so they can be replaced with hyphens.
Use with a lowercase transform and trim step to turn ordinary text into URL-friendly slugs.
Find
[^a-z0-9]+
Replace
-
Matches Markdown heading lines from level one through six.
Use this to find ATX-style Markdown headings in editors and content-processing scripts.
Find
^#{1,6}\s+.*$Matches HTML-looking tags for simple text cleanup.
Use only for simple cleanup of trusted, predictable markup; use an HTML parser for real sanitization or transformation.
Find
<[^>]*>
Matches valid dotted-decimal IPv4 addresses such as 192.168.1.1.
Use word boundaries so the pattern finds addresses inside longer text without matching fragments of bigger numbers.
Find
\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\bCaptures the entry type, citation key, and body of a BibTeX record to normalize or repair it.
Normalizes mixed brace and parenthesis entries into the standard @type{key, body} form with a find-and-replace.
Find
@(\w+)\s*[{(]([^,\s]+)\s*,([\s\S]*?)[})]Replace
@$1{$2,$3}