utilities
Essential
100% In-Browser Execution

Regex Tester

Real-time JavaScript regular expression tester with interactive match highlighting, flag toggles (g, i, m, s, u), match counts, capture group inspector, and error explanation.

//g
Flags:
Valid Regex
2 matches
Contact Information: Email: ada.lovelace@computing.org Phone: +1 (555) 234-5678 Backup Email: support@devtoolshub.dev Server URL: https://api.devtoolshub.dev/v1/health IPv4 DNS: 8.8.8.8 and Gateway: 192.168.1.1 Invalid: test@@wrong..com
Capture Groups Inspector
Match #1: “ada.lovelace@computing.org” (Index 28–54)
Group #1:ada.lovelace
Group #2:computing.org
Match #2: “support@devtoolshub.dev” (Index 94–117)
Group #1:support
Group #2:devtoolshub.dev

Most Popular & Frequently Used Regular Expressions

Production-tested regex patterns for form validation, networking, data formats, and web development.

Email Address (RFC 5322)Validation

Matches standard email addresses with alphanumeric characters, common symbols, and domain extension.

/([a-zA-Z0-9._%+-]+)@([a-zA-Z0-9.-]+\.[a-zA-Z]{2,})/g
URL / Web Address (HTTP/HTTPS)Web & Network

Matches complete web links with protocol (http/https), domain, optional port, and query string path.

/https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&//=]*)/g
IPv4 AddressWeb & Network

Strictly validates standard dotted-decimal IPv4 addresses from 0.0.0.0 through 255.255.255.255.

/\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]?)\b/g
IPv6 AddressWeb & Network

Matches standard 8-group hexadecimal IPv6 network addresses.

/\b(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}\b/g
UUID v4Formats & Data

Matches standard 36-character RFC 4122 version 4 cryptographically random UUIDs.

/\b[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}\b/g
Date (YYYY-MM-DD)Formats & Data

Matches ISO 8601 calendar dates with 4-digit year, 2-digit month (01-12), and day (01-31).

/\b\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])\b/g
24-Hour Time (HH:MM:SS)Formats & Data

Matches 24-hour military timestamp with hours (00-23), minutes, and optional seconds.

/\b(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d)?\b/g
Phone Number (International / E.164)Validation

Matches international standard E.164 telephone numbers with optional leading plus sign.

/\+?[1-9]\d{1,14}\b/g
Strong PasswordValidation

Ensures at least 8 characters, at least 1 uppercase letter, 1 lowercase letter, 1 number, and 1 special symbol.

/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/
HEX Color CodeProgramming

Matches 3, 4, 6, or 8-digit CSS hexadecimal color codes preceded by #.

/#(?:[0-9a-fA-F]{3,4}){1,2}\b/g
Semantic Versioning (SemVer)Programming

Matches SemVer 2.0 release formats (major.minor.patch) with optional pre-release suffixes.

/\bv?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[0-9a-zA-Z.-]+)?\b/g
Slug / Kebab-CaseProgramming

Matches URL-friendly lowercase slugs separated by hyphens.

/^[a-z0-9]+(?:-[a-z0-9]+)*$/
HTML / XML TagsProgramming

Extracts matched opening and closing HTML elements with attributes.

/<([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>(.*?)<\/\1>/g
Credit Card NumberValidation

Matches major credit cards: Visa (13/16 digits), MasterCard (16 digits), Amex (15 digits), Discover (16 digits).

/\b(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|3[47][0-9]{13}|6(?:011|5[0-9]{2})[0-9]{12})\b/g
JWT Token StructureProgramming

Matches three-segment Base64URL encoded JSON Web Tokens (Header.Payload.Signature).

/\b[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.[A-Za-z0-9-_.+/=]*\b/g
Quick Usage Guide & Examples(Click to toggle reference)
How to Use
  1. Enter your regular expression between the forward slashes (e.g., [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}).
  2. Toggle flags such as 'g' (Global search), 'i' (Case-insensitive), 'm' (Multiline), and 's' (DotAll).
  3. Type or paste your test text into the 'Test String Input' panel.
  4. Inspect the real-time match count and green highlights in the 'Interactive Match Highlighting' preview.
  5. Scroll down to the 'Capture Groups Inspector' to review matched sub-expressions and named capture groups.
Examples

Email Address Matching with Capture Groups

Input
Pattern: ([a-zA-Z0-9._%+-]+)@([a-zA-Z0-9.-]+\.[a-zA-Z]{2,})
Text: Contact ada@computing.org for help
Output
Match 1: 'ada@computing.org' (Group 1: 'ada', Group 2: 'computing.org')

Extracting IPv4 Addresses

Input
Pattern: \b(?:\d{1,3}\.){3}\d{1,3}\b
Text: Gateway: 192.168.1.1 and DNS: 8.8.8.8
Output
Match 1: '192.168.1.1', Match 2: '8.8.8.8'

Related Utilities

Discover other in-browser tools frequently used alongside this utility.

All tools