Regex Tester
Test regular expressions in real time. Highlight matches, inspect groups, explain patterns, replace text, and browse a library of common regex.
Pattern & Test String
/
/gm
0
Matches
0
Groups
0
Chars Matched
0
Lines Matched
0
Time (ms)
Match Results
| # | Match | Groups | Index | Length |
|---|
Replace
Pattern Explanation
Enter a regex pattern above to see its explanation.
Generate Regex from Examples
Provide sample strings that should match, and get a suggested regex pattern.
Common Patterns Library
How It Works
Regex Flavors
- JavaScript (PCRE-like): Supports lookahead, lookbehind, named groups, and all standard JS flags. This is the default and processes patterns using the browser's native RegExp engine.
- POSIX ERE: Extended Regular Expressions used by
grep -E,awk, andsed -E. Character classes like[:alpha:]are translated to Unicode-aware equivalents.
Flags
g— Global: find all matches, not just the firsti— Case insensitive matchingm— Multiline:^and$match line boundariess— Dotall:.matches newline charactersu— Unicode: treat pattern as Unicode code points
Features
- Real-time matching: Matches are highlighted as you type with alternating colors for adjacent matches
- Match details: Full table showing each match, its capture groups, position, and length
- Replace: Test replacement strings with capture group references ($1, $2)
- Pattern explanation: Human-readable breakdown of each component in your regex
- Generate from examples: Provide sample strings and get a suggested pattern
- Common patterns library: One-click access to frequently used regex patterns
Quick Reference
Character Classes
.— any character (except newline)\d— digit [0-9]\w— word character [a-zA-Z0-9_]\s— whitespace[abc]— character set[^abc]— negated set
Quantifiers
*— 0 or more+— 1 or more?— 0 or 1{n}— exactly n{n,m}— between n and m*?,+?— lazy versions
Common Use Cases
- Validation: Email addresses, phone numbers, passwords
- Extraction: URLs, dates, numbers from text
- Search & Replace: Find and replace patterns in text
- Parsing: Log files, CSV data, structured text
Related Utils
Feedback
Help us improve this page by providing feedback, and include your name/email if you want us to reach back. Thank you in advance.
Sending...
Feedback sent. Thank you!
Error occurred!
-
-
-
-
-
-
-
- ABI Encoder / Decoder
- Block Estimator
- Calldata Cost
- CREATE2 Address
- ENS Availability
- ENS Cost Estimator
- ENS Lookup
- ENS Namehash
- ENS Record Viewer
- ENS Subname Explorer
- ERC-20 Unit Converter
- Gas Estimator
- HD Wallet Derivation
- Merkle Tree Visualizer
- 4-Byte Selector Lookup
- Solidity Storage Layout
- Transaction Decoder
- Vanity Address Estimator
- Wallet Address Validator
- Wei/Gwei/Ether Converter
-
-
-
-
-
- API Response
- ASCII Table
- Code Bug Detector
- Code Explanation
- CSS Beautifier
- Env Parser
- GraphQL Query
- Syntax Highlight
- HTML Beautifier
- JS Beautifier
- JSON Formatter
- JSONPath
- JWT Decoder
- JS keyCodes
- API Lorem Ipsum
- RegExp
- Regex Library
- Semver Compare
- SQL Beautifier
- TOML Formatter
- Code Unminifier
- XML Beautifier
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Amortization
- Break-Even
- Compound Interest
- Crypto Profit/Loss
- Debt Payoff
- Discount
- Effective Interest
- Emergency Fund
- Inflation Calculator
- Simple Interest
- Invoice Calculator
- IRR Calculator
- Mortgage
- NPV Calculator
- Portfolio
- Profit Margin
- Rent vs Buy
- Retirement Calc
- ROI Calculator
- Salary vs Hourly
- Savings Goal
- Tax Calculator
- VAT
-
-
-
-
-
-
-
-
-
-
-
-
- Equation Solver
- Exponent Calculator
- Factorial Calculator
- Fibonacci Sequence
- Fraction Calculator
- Fraction Simplifier
- GCD Calculator
- GCD/LCM
- Least Common Multiple (LCM) Calculator
- Logarithm Calculator
- Magic Square
- Matrix Calculator
- Number Base Converter
- Pascal's Triangle
- PDE Solver
- Prime Checker
- Prime Factorization
- Roman Numbers
- Scientific Notation
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Broken Link Checker
- Canonical URL Checker
- Core Web Vitals Checker
- Favicon
- Heading Structure
- Keyword Density
- Meta Tags
- Mobile-Friendly Test
- Open Graph Tags
- Page Load Time Analyzer
- Redirect Checker
- robots.txt
- Schema Markup
- SEO Optimized Checklist
- XML Sitemap
- Time on Page Tracker
- Page Title & Desc.
- Twitter Card Generator
-
-
-
-
-
-
- Acceleration
- Substance Amount
- Angle
- Area
- Astronomical
- Base Converter
- Capacitance
- Electric Charge
- Data Transfer
- Data Storage
- Density
- Energy Converter
- Force Converter
- Frequency Converter
- Fuel Economy
- Illuminance
- Inductance
- Length / Distance
- Power
- Pressure
- Electrical Resistance
- Time
- Speed
- Temperature
- Viscosity
- Volume
- Weight
-
-
-
-
-