Copy a regex that actually works — then test it on your own data
Every page here is one job done right: a prebuilt pattern for a real task, a live tester, and a plain-English explanation of why it works. No signup, no 20-tab rabbit hole.
Pattern library
- Atomic Groups & Possessive Quantifiers: Support and Why They Matter — Atomic groups (?>...) and possessive quantifiers ++ *+ prevent catastrophic backtracking. Which engines support them (Java, PCRE, Python regex; not JS or RE2) with examples.
- Go Regexp (RE2): What It Can't Do and How to Work Around It — Go's regexp package uses RE2, which drops lookaround and backreferences for guaranteed linear-time matching. What breaks when you port a pattern to Go, and how to fix it.
- Regex Lookbehind Support by Language (JS, Python, Go, Java, PHP) — Which regex engines support lookbehind — and which reject it. JavaScript (ES2018), Python, Java, PHP/PCRE all differ; Go's RE2 has none. With copy-ready examples.
- Regex Named Groups: Syntax by Language (and How to Read Them) — Named group syntax differs by engine: (?<name>...) vs (?P<name>...). How to define and read named groups in JavaScript, Python, Java, PHP, .NET and Go, with examples.
- Regex Unicode Property Escapes \p{...} — Support and Usage — How to match letters, numbers and scripts across languages with \p{L}, \p{N}, \p{Script=Greek}. Support in JavaScript (u flag), Python, Java, PCRE and Go, with examples.
- Regex to Match Alphanumeric Only — A regex that matches strings containing only letters and digits (A-Z, a-z, 0-9) with no spaces or symbols. Paste values and see which are clean.
- Regex to Match Digits Only — A regex that matches strings containing only digits 0-9, with no letters, spaces, or signs. Useful for validating numeric IDs and codes.
- Regex to Match Letters Only — A regex that matches strings of alphabetic characters only (A-Z, a-z) with no digits, spaces, or symbols. Paste values to validate.
- Regex to Match a Canadian Postal Code — A regex that matches Canadian postal codes in the A1A 1A1 format. Paste addresses and see each postal code highlighted.
- Regex to Match an HTML Comment — A regex that matches HTML comments like <!-- note --> including multi-line comments. Paste markup to highlight or strip comments.
- Regex to Match an IBAN — A regex that matches an International Bank Account Number: two country letters, two check digits, then up to 30 alphanumerics. Paste IBANs to validate the shape.
- Regex to Match a Negative Number — A regex that matches negative integers and decimals like -5, -3.14 and -0.5. Paste text and see each negative value highlighted.
- Regex to Match a Port Number (0-65535) — A regex that matches a valid TCP/UDP port number from 0 to 65535 and rejects anything larger. Paste values to validate.
- Regex to Match Scientific Notation — A regex that matches numbers in scientific / E-notation like 6.02e23, -1.6E-19 and 3e8. Paste text to highlight each value.
- Regex to Match Special Characters — A regex that finds any special character (non-alphanumeric, non-space) in text. Useful for password rules and input sanitising.
- Regex to Match a UK Postcode — A regex that matches UK postcodes like SW1A 1AA, EC1A 1BB and M1 1AE. Paste addresses and see each postcode highlighted.
- Regex to Match a VIN (Vehicle Identification Number) — A regex that matches a 17-character VIN, excluding the letters I, O and Q. Paste VINs to validate the format.
- Regex Character Classes: \d \w \s and Custom Sets — How character classes work in regex: shorthand classes like \d \w \s, custom sets with [ ], ranges, negation and the gotchas inside brackets.
- Regex Cheat Sheet — Every Token With Examples — A compact regex cheat sheet: anchors, character classes, quantifiers, groups, lookarounds and flags — each with a working example you can copy and test.
- Regex Flags Explained: g, i, m, s, u, y — What each regex flag does — global, ignore-case, multiline, dotall, unicode and sticky — with examples and the differences between JavaScript, Python and PCRE.
- Regex Lookahead and Lookbehind, Explained With Examples — Positive and negative lookahead and lookbehind explained with real examples: assert what comes before or after a match without consuming it.
- Regex Quantifiers: Greedy vs Lazy (*, +, ?, {n,m}) — Why .* matches too much and .*? fixes it. A clear guide to greedy, lazy and possessive quantifiers in regex, with examples you can test.
- Regex to Match a Base64 String (live tester) — A regular expression that validates standard Base64 strings, including correct = padding. Paste a value and see whether it is well-formed Base64.
- Regex to Match a Domain Name (live tester) — A regular expression that matches bare domain names like example.com or sub.domain.co.uk, without needing a full URL. Paste text and highlight every domain.
- Regex to Match a File Extension (live tester) — A regular expression that captures the extension at the end of a filename, like .jpg or .tar.gz. Paste filenames and highlight each extension.
- Regex to Match an HTML Tag (live tester) — A regular expression that matches opening, closing, and self-closing HTML tags with their attributes. Paste markup and highlight every tag.
- Regex to Match an Integer (optional sign, live tester) — A regular expression that matches whole numbers with an optional minus sign, like 42, -7 and 1000. Paste text and highlight every integer.
- Regex to Match an ISBN-13 (live tester) — A regular expression that matches 13-digit ISBNs with optional hyphens or spaces, like 978-0-13-468599-1. Paste text and highlight every ISBN.
- Regex to Match a JWT Token (live tester) — A regular expression that matches JSON Web Tokens: three Base64URL segments separated by dots. Paste text and highlight every JWT.
- Regex to Match an International Phone Number (E.164, live tester) — A regular expression that matches E.164 international phone numbers like +14155552671, with a leading plus and up to 15 digits. Paste text and highlight each number.
- Regex to Match a Roman Numeral (live tester) — A regular expression that matches valid Roman numerals from I to MMMCMXCIX, rejecting malformed forms like IIII. Paste text and highlight each numeral.
- Regex to Match a US Social Security Number (live tester) — A regular expression that matches US Social Security Numbers in the AAA-GG-SSSS format. Paste text and highlight every SSN for redaction.
- Regex for MM/DD/YYYY Date (US format, live tester) — A regular expression that matches US-style dates like 09/28/2026, rejecting impossible months and days. Paste your text and watch every date highlight.
- Regex to Match a UUID v4 Specifically (live tester) — A regular expression that matches only version-4 UUIDs, checking the version and variant nibbles. Paste text and highlight every v4 UUID.
- Regex to Extract a YouTube Video ID (live tester) — A regular expression that pulls the 11-character video ID from any YouTube URL: watch, youtu.be, embed, or shorts. Paste URLs and capture each ID.
- Regex to Replace Multiple Spaces With One — A regular expression that matches runs of two or more whitespace characters so you can collapse them to a single space. Paste your text and see every run it finds.
- Regex to Match a Credit Card Number — A regular expression that matches Visa, Mastercard, American Express and Discover card numbers. Paste your text and see which numbers match. Never store raw card numbers.
- Regex for a YYYY-MM-DD Date — A regular expression that matches ISO-style dates in YYYY-MM-DD format, such as 2026-09-10, and rejects impossible month or day values. Test it against your own text.
- Regex to Match a Decimal Number — A regular expression that matches decimal numbers including optional sign and fractional part, such as 3.14, -0.5 and 42. Paste your text and see every number it matches.
- Regex to Match a Dollar Amount — A regular expression that matches US dollar amounts like $1,250.00 and $9.99. Paste your text and see each price highlighted.
- Regex to Extract the Domain from a URL — A regular expression that pulls the host/domain out of a URL, ignoring the scheme, path and query. Paste URLs and see each domain captured.
- Regex to Match an @Mention — A regular expression that matches @mentions and social handles like @jane_doe. Paste your text and see every handle highlighted.
- Regex to Extract Numbers from a String — A regular expression that pulls every number — integers, decimals, and negatives — out of a block of text. Paste your text and see each number it captures.
- Regex to Match a Hashtag — A regular expression that matches social-media hashtags like #Regex and #dev2026 while ignoring numbers-only tags. Paste your posts and see every hashtag it finds.
- Regex to Match a Hex Color Code — A regular expression that matches CSS hex colors in #RGB, #RGBA, #RRGGBB and #RRGGBBAA form, such as #fff and #1a2b3c. Paste your stylesheet and see every color it finds.
- Regex to Match an IPv4 Address — A regular expression that matches valid IPv4 addresses from 0.0.0.0 to 255.255.255.255 and rejects octets above 255. Paste your own log lines and see every IP it finds.
- Regex to Match an IPv6 Address — A regular expression that matches full-form IPv6 addresses like 2001:0db8:85a3:0000:0000:8a2e:0370:7334. Paste your text and see every address it finds.
- Regex to Match an ISO 8601 Date-Time — A regular expression that matches ISO 8601 timestamps like 2026-09-17T12:30:00Z. Paste your log lines and see each timestamp highlighted.
- Regex to Match Latitude and Longitude — A regular expression that matches a decimal latitude,longitude coordinate pair like 40.7128,-74.0060. Paste your text and see every coordinate it finds.
- Regex to Match a MAC Address — A regular expression that matches MAC addresses in colon or hyphen form, such as 01:23:45:67:89:ab and 01-23-45-67-89-AB. Paste your text and see every MAC it finds.
- Regex to Match a Markdown Link — A regular expression that matches Markdown inline links like [text](https://example.com) and captures the text and URL separately. Paste your Markdown and see every link.
- Regex to Match an Email Address — A practical regular expression that matches everyday email addresses like name@example.com and first.last@sub.domain.co.uk. Paste your own text and watch it highlight every match.
- Regex to Match a URL — A practical regular expression that matches http and https URLs like https://example.com/path?q=1 inside plain text. Paste your own text and see every link it finds.
- Regex to Match Whitespace — A regular expression that matches spaces, tabs, newlines and runs of whitespace. Paste your text and see every whitespace run highlighted.
- Regex to Match Non-ASCII Characters — A regular expression that finds every non-ASCII character so you can strip or flag them. Paste your text and see each highlighted.
- Regex to Match a Semantic Version — A regular expression that matches semver strings like 1.2.3, 2.0.0-rc.1 and 1.0.0+build.5. Paste versions and see each valid one highlighted.
- Regex to Strip HTML Tags — A regular expression that matches HTML tags like <p>, </div> and <a href="..."> so you can strip them and keep the text. Paste your markup and see every tag it removes.
- Regex for Strong Password Validation — A regular expression that requires at least 8 characters with one lowercase, one uppercase, one digit and one special character. Paste candidate passwords and see which pass.
- Regex to Match 24-Hour Time (HH:MM) — A regular expression that matches 24-hour times from 00:00 to 23:59, with optional seconds. Paste your logs and see every timestamp it finds.
- Regex to Match a URL Slug — A regular expression that matches lowercase URL slugs like my-first-post, made of letters, digits, and single hyphens. Paste candidates and see which are valid slugs.
- Regex to Validate a US Phone Number — A regular expression that matches US phone numbers in common formats like (415) 555-2671, 415-555-2671 and 4155552671, with an optional +1 country code. Test it on your own list.
- Regex to Match a US ZIP Code — A regular expression that matches US ZIP codes in 5-digit and ZIP+4 form, such as 90210 and 90210-1234. Paste your addresses and see every ZIP it finds.
- Regex to Validate a Username — A regular expression that validates usernames of 3-16 characters using letters, digits, underscores and single dots, with no leading or trailing separator. Test your rules here.
- Regex to Match a UUID — A regular expression that matches a standard UUID like 123e4567-e89b-12d3-a456-426614174000 in the 8-4-4-4-12 hex format. Paste your text and see every UUID it finds.
- Regex to Match a Windows File Path — A regular expression that matches absolute Windows file paths like C:\Users\Jane\file.txt. Paste your text and see every path it finds.