Test String
Free Regex Tester – Test Regular Expressions Online
Regex Tester lets you test and debug regular expressions online for free. Live match highlighting with flags support.
Written & reviewed by Helperzy Editorial Team · Updated July 2026
How to Use Regex Tester
Enter Your Regex Pattern
Type your regular expression in the pattern field and switch on the flags you need, such as g for every match or i to ignore case. Malformed patterns show the engine error straight away.
Enter Test String
Paste realistic sample text below the pattern, ideally including cases that should match and cases that should not. Multi-line input works, which matters when testing the m and s flags.
View Matches
Every match highlights live as you edit, and the details panel lists each match position alongside what every numbered and named capture group holds. Adjust the pattern until only the intended text matches.
What Is a Regex Tester and How Does It Work
A regular expression is a compact description of a text pattern, and a regex tester is the workbench where you build one without guessing. You type the pattern in one box, paste sample text in another, and every match lights up as you edit. Developers, data analysts, log-hunting sysadmins and anyone writing a validation rule end up here sooner or later, because regex is famously easy to get almost right and very hard to get exactly right. The value is the feedback loop. Rather than editing a pattern in your code, running the file, squinting at the output and repeating, you see the effect of each keystroke immediately, which turns a twenty-minute fight into a two-minute one. Under the hood the tool builds a live RegExp object from your pattern and flag selection, then runs it against the test text on every change. Matches are collected with their start index, their full matched text, and the contents of every capture group, both numbered and named. Capture groups are the parentheses in your pattern; group 1 is the first opening bracket, group 2 the second, and so on. The flags change the engine behaviour: g finds every match instead of stopping at the first, i ignores letter case, m makes the anchors ^ and $ line up with line starts and ends rather than the whole string, s lets the dot match newline characters, and u switches on proper Unicode handling for scripts and emoji. If the pattern itself is malformed, the error from the engine is shown rather than an empty result, so a stray unclosed bracket is obvious immediately. Work through a real one. Set the pattern to (\d{4})-(\d{2})-(\d{2}) with the g flag on, and paste the text: Invoice 2026-03-14 paid, refund 2025-11-02 pending. Two matches highlight. The first is 2026-03-14 starting at index 8, with group 1 holding 2026, group 2 holding 03 and group 3 holding 14. The second is 2025-11-02, giving groups 2025, 11 and 02. Now turn the g flag off. Only the first date stays highlighted, which is the single most common reason a pattern looks broken in real code. Change the quantifier {4} to {2} and watch the first match shrink to 20 followed by a failure, a quick reminder that quantifiers count characters, not logical fields. Concrete jobs this handles well. A backend developer writing an nginx log parser tests a pattern against ten pasted log lines to confirm it captures the IP, timestamp and status code as separate groups before committing the pipeline. A form developer checks that a postcode rule accepts every valid sample and rejects the four bad ones a tester filed last week. A data analyst cleaning a scraped CSV builds a find-and-replace pattern to strip trailing footnote markers from thousands of product names, verifying it on twenty rows first. A QA engineer confirms a password policy pattern actually requires a digit rather than merely allowing one, which is a mistake that ships more often than you would expect. Two things to watch. First, greedy quantifiers: by default * and + grab as much text as they can, so with the text <a><b> the pattern <.*> swallows the whole line while <.*?> stops at <a>. Beginners almost always want the lazy version and do not know it exists. Second, flavour differences: this runs the JavaScript engine because it lives in your browser, and Python, PCRE, Java and Go each differ on named-group syntax, lookbehind support and Unicode property escapes. Treat a pass here as strong evidence, not a promise, when your target language is different. Patterns and test text stay in your browser and are never uploaded anywhere.
Examples: Regex Tester
Input
Pattern: (\d{4})-(\d{2})-(\d{2}) with flags g — Test text: Invoice 2026-03-14 paid, refund 2025-11-02 pending
Result
2 matches. Match 1: 2026-03-14 at index 8, groups = 2026 / 03 / 14. Match 2: 2025-11-02 at index 31, groups = 2025 / 11 / 02
\d{4} takes exactly four digits for the year, then two literal hyphens split off two-digit month and day groups; the g flag is what makes the engine continue past the first date.
Input
Pattern: <.*> versus <.*?> — Test text: <a><b>
Result
<.*> matches the whole string <a><b>; <.*?> matches only <a>
The greedy .* extends to the last possible > character, while adding ? makes it lazy so it stops at the first > it can.
Frequently Asked Questions – Regex Tester
Enter your regular expression in the pattern field and your sample text in the test string box below. Helperzy highlights every match in real time as you type, so you get instant feedback without running any code. You can adjust the pattern and immediately see how the matches change, which makes it easy to refine an expression until it behaves exactly as you want.
Learn More — Regex Tester Guide
Related Developer Tools
View all Developer toolsUUID Generator
UUID Generator creates random UUIDs (v4) and GUIDs online for free. Generate unique identifiers instantly for databases, APIs, and development. No signup needed.
Image to Base64 Converter
Image to Base64 Converter encodes any image into a Base64 data URI online for free. Get ready-to-use CSS and HTML code in your browser.
JSON to YAML Converter
JSON to YAML Converter changes JSON into clean YAML instantly online for free. Validate and convert config data in your browser with no upload.
Cron Expression Generator
Cron Expression Generator builds and explains cron schedules online for free. Create cron expressions with a plain-English description in your browser.
🔥 Trending Tools
Image Resizer
Image Resizer changes image dimensions online — set exact pixels, use percentage scaling, or pick from 12 presets (Instagram, Passport, YouTube, etc.). Target specific file sizes like 50KB or 100KB. Batch resize multiple images. 100% free, browser-based.
Image Converter
Image Converter changes images between any format online free — JPG, PNG, WebP, AVIF, PDF, ICO, BMP, HEIC, GIF, SVG. Batch conversion, resize, rotate, flip, AI format recommendation. 100% browser-based, no upload.
JPG to WebP Converter
Convert JPG to WebP format online free — reduce image file size by 25-35% with identical visual quality. Batch conversion, adjustable quality, lossless mode available. Boost website speed and Core Web Vitals scores. 100% browser-based, no upload needed.
PNG to WebP Converter
Convert PNG to WebP format online free — reduce file size by 26-34% while preserving full transparency. Batch conversion, lossless and lossy modes, adjustable quality. Boost website performance and Core Web Vitals. 100% browser-based, no upload needed.