Regex Tester and Explainer | Test Matches and Capture Groups
Last updated: August 2026 · Free · No sign-up required
Test JavaScript regular expressions against sample text, highlight matches, and inspect capture groups locally in your browser.
How this tool works
How regex testing works
The tester creates a JavaScript RegExp from the pattern and flags, applies it to the sample text, and displays match positions and capture groups. Invalid syntax is reported without executing arbitrary code.
Engine scope
Results follow the browser’s JavaScript regular-expression engine. PCRE, Python, .NET, and Rust regex dialects can support different syntax and behavior.
Worked example
Enter representative inputs, review the result, and adjust assumptions to compare scenarios.
Frequently asked questions
What is a regex tester?
A regex tester applies a regular-expression pattern to sample text and shows whether and where matches occur.
What do regex flags do?
Flags change matching behavior. For example, g finds multiple matches, i ignores case, and m changes line-anchor behavior in JavaScript.
What is a capture group?
A capture group is a parenthesized part of a pattern whose matched text is returned separately from the full match.
Why does my regex not match?
Check escaping, capitalization, whitespace, anchors, flags, and the regex dialect expected by your target programming language.
Which regex engine does this use?
It uses the browser’s JavaScript RegExp engine, which can differ from PCRE, Python, .NET, or other engines.
Is my sample text uploaded?
The tester is designed to run matching in the browser. Avoid entering confidential data into any online tool and use local tooling for sensitive samples.
Quick reference
| Pattern | Meaning | Matches |
|---|---|---|
| d{3} | Exactly 3 digits | 123, 456 |
| [A-Za-z]+ | One or more letters | abc, Word |
| s | Whitespace | space, tab |
| ^...$ | Start / end anchors | whole-string match |
| (a|b) | Alternation (a or b) | cat, bat |
code Live explainer
Every token decoded.
science Test harness
Try the pattern on real text.
lightbulb Pro tip
Anchor first, match later.
lightbulb Worked example
Result: One match, three capture groups: year, month, day.
Formula & methodology
Formula: a match exists when the regular-expression engine finds a substring satisfying the pattern and selected flags
How regex testing works
The tester creates a JavaScript RegExp from the pattern and flags, applies it to the sample text, and displays match positions and capture groups. Invalid syntax is reported without executing arbitrary code.
Engine scope
Results follow the browser’s JavaScript regular-expression engine. PCRE, Python, .NET, and Rust regex dialects can support different syntax and behavior.
Authoritative source: MDN JavaScript RegExp reference
Explore the full everyday toolkit
Every CalcaTools everyday calculator — dates, time, age, measurements, home projects, and lifestyle tools — ready when you need a quick answer.
- Age Calculator | Get Exact Age Between Two Dates
- Age Difference Calculator | Compute exact age gap and totals
- AI API Cost Calculator | Estimate Token and Monthly Usage Costs
- Average Time Calculator | Find Mean Time From Multiple Entries
- Birthday Countdown Calculator | Countdown To Your Next Birthday
- Bra Size Calculator | Determine Band, Cup, and Sister Sizes
- BTU Calculator | Recommend Heating or Cooling Capacity for Rooms
- Carbon Footprint Calculator | Estimate annual CO2 emissions
- Concrete Calculator | Estimate Volume and Number of Bags Needed
- Cron Expression Builder | Validate and Find Next Run Times
- Date Calculator | Count days, weeks, months, and years between dates
- Days Alive Calculator | Calculate Days, Weeks, and Months Lived
- Days From Today Calculator | Find Date N Days Ahead Or Behind
- Density Calculator | Compute mass, volume, or density using formula
- Dew Point Calculator | Calculate Dew Point from Temp and Humidity
- E-commerce Profit Margin Calculator | Estimate Net Profit per Order
- Electricity Calculator | Calculate Appliance Energy Use and Cost
- Engine Horsepower Calculator | From Torque & RPM
- Etsy Fee Calculator | See Net Profit After All Etsy Fees
- EV Charging Cost and Time Calculator | Compare Charging Costs
- EV Charging Cost Calculator | Estimate EV charging costs
- Freelance Rate Calculator | Set Hourly, Daily, and Project Rates
- Fuel Cost Calculator | Estimate Trip Fuel Cost and Cost Per Mile
- Fuel Tank Capacity Calculator | Find Tank Volume From Dimensions
- GDP Calculator | Compute Nominal and Real GDP From Expenditure
- Golf Handicap Calculator | Compute handicap differential from a round
- GPA Calculator | Compute Semester and Cumulative GPA With Weights
- GPA Planner Calculator | Project Your Graduation GPA
- Grade Calculator | Find Current Grade and Needed Final Exam Score
- Grade Goal Calculator | Find the Score Needed on Remaining Work
- Gravel Calculator | Estimate Cubic Yards And Tons From Area
- Heat Index Calculator | Compute Feels-Like Temp and Heat Risk
- Heat Pump Savings Calculator | Compare Heating Costs
- Height Calculator | Convert Units and Predict Adult Height
- Home Energy Usage Calculator | Estimate Appliance Electricity Cost
- Horsepower Calculator | Compute Horsepower From Torque and RPM
- Hours Calculator | Find elapsed time and decimal hours for payroll
- How Long Have We Been Together Calculator | Get exact time
- How Old Am I Calculator | Calculate Exact Age And Time Lived
- I’tikaf Days Calculator | Find Ramadan’s Last Ten Nights
- JSON, YAML and XML Formatter | Validate and Convert Data
- Khums Calculator (Shia) | Compute 20% Khums After Expenses
- Mass Calculator | Solve mass, density, or volume and convert units
- Mileage Calculator | Track Fuel Economy, Cost Per Mile, and Trips
- Missed Prayers Qadha Calculator | Estimate missed prayers’ time
- Molarity Calculator | Compute Moles, Molarity, Mass, or Volume
- Molecular Weight Calculator | Molar Mass in g/mol & Moles
- MPG Calculator | Compute Fuel Economy In MPG, L/100km, And km/L
- Mulch Calculator | Estimate Volume and Bags Needed for Beds
- Ohm’s Law Calculator | Solve Voltage, Current & Power
- Paint Calculator | Estimate Paint Quantity and Cost
- Pizza Calculator | Compute Slices Needed and Pizzas to Order
- Quranic Verse Juz Counter | Estimate finish date by Juz pace
- Resistor Calculator | Decode Colour Bands and Combine Values
- Roofing Calculator | Estimate Roof Area and Shingle Needs
- SaaS MRR Calculator | Project ARR, LTV, Churn, and CAC Payback
- Septic Tank Size Calculator | Estimate Tank Size From Bedrooms
- Shoe Size Conversion | Convert US, UK, EU, and cm Sizes
- Sleep Calculator | Find Bedtimes and Wake Times by Sleep Cycles
- Solar Battery Payback Calculator | Estimate Storage ROI
- Solar Panel Savings Calculator | Estimate savings & payback
- Speed Calculator | Compute Speed, Distance or Time, Convert Units
- Square Footage Calculator | Measure area in square feet and meters
- Stair Calculator | Design Steps from Total Rise with Rise and Run
- Subscription Cost Calculator | Compare Monthly and Annual Spending
- Tile Calculator | Calculate tiles needed, waste allowance, and packs
- Tile Calculator | Estimate Tiles, Waste, Grout, and Cost
- Time Card Calculator | Total Hours, Overtime, and Estimated Pay
- Time From Now Calculator | Find Time After Or Before A Duration
- Time to Decimal | Convert Hours to Decimal for Payroll
- Time Until Calculator | Show Live Countdown To Target Date/Time
- Time Zone Meeting Planner | Find the Best Meeting Time
- Tire Size Calculator | Diameter, Revs & Speedo
- Travel Budget Calculator | Plan Daily Trip Spending and Costs
- Voltage Drop Calculator | Estimate Voltage Drop and Percentage
- Wasiyyah Islamic Will Calculator | Compute max one-third bequest
- Weight Calculator | Convert Pounds, Kilograms, Ounces, and Stones
- Wind Chill Calculator | Get feels-like temp & frostbite risk
- Years Ago Calculator | Find Date and Weekday N Years Earlier