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
- 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.