🧩 Regex Tester

Test regular expressions live against your own text — with highlighted matches, capture groups, all flags, replace & split modes, statistics and ready-made patterns. 100% local — nothing is uploaded.

/ /
⚡ Try:

Matches: 0 Unique: 0 Duplicates: 0 Groups: 0 Chars: 0 Time: Complexity:

👁️ Highlighted matches

Matches will be highlighted here.

📋 Match list (0)

🕒 Recent patterns
No history yet.
🔒 Private by design: your pattern and test text are matched entirely in your browser with the native JavaScript regex engine. Nothing is uploaded, and the tool works offline once loaded.

✨ Key Features

👁️ Live Highlighting

Matches light up in your text as you type, with alternating colours so adjacent matches are clear.

🎚️ All Flags

Toggle g, i, m, s, u, y and d — global, ignore-case, multiline, dotall, unicode, sticky and indices.

🎯 Capture Groups

Every match lists its numbered and named capture groups and its index in the text.

🔁 Replace Mode

Preview a replacement live using $1, $& and named references before you commit.

✂️ Split Mode

Split text by your pattern and see each resulting piece listed.

📊 Statistics

Total, unique and duplicate matches, group count, characters tested, timing and a complexity score.

⚡ Ready-Made Patterns

One-click email, URL, IP, date, plus India-specific PAN, Aadhaar, GST, IFSC and PIN patterns.

✅ Instant Validation

Invalid patterns are flagged immediately with the exact error message.

📤 Export

Copy matches or export them as TXT, CSV or JSON for reports and tests.

🕒 History

Recent patterns are remembered locally so you can restore them in a click.

🔒 100% Local

Everything runs in your browser. Nothing is uploaded, logged or tracked.

♿ Accessible & Mobile

Keyboard navigation, ARIA labels, high-contrast support and a responsive layout.

🎯 Benefits

🧰 Related Tools

ℹ️ About This Tool

The ApneSoftware Regex Tester is a professional, privacy-first workbench for writing, testing and debugging regular expressions directly in your browser. A regular expression — regex for short — is a compact pattern language for describing text: it lets you find, validate, extract, replace and split strings based on rules rather than fixed values. Regex is one of the most powerful tools a developer, data analyst, tester or writer can learn, but it is also famously easy to get wrong. A pattern that looks correct can silently miss edge cases, match too much, or fail on real-world input. The cure is fast feedback, and that is exactly what this tool provides: type a pattern, paste some text, and watch every match light up instantly, complete with the groups it captured and the statistics of what happened.

At the centre is a live testing engine built on the browser's own JavaScript regex engine, so the results you see here are the same results your code will get. As you type, the tool compiles your pattern, validates it, and — if it is valid — runs it against your test string and highlights every match in place, using alternating colours so that adjacent matches remain distinct. Below the highlight view, a match list enumerates each match with its position in the text and a full breakdown of its capture groups, both numbered ($1, $2) and named ((?<year>…)). If your pattern is invalid, the tool shows the precise error message from the engine — a missing bracket, an unterminated group, an invalid escape — so you can fix it immediately instead of hunting blind.

Every regex flag is a single click away. The g (global) flag finds all matches rather than just the first; i makes matching case-insensitive; m (multiline) makes ^ and $ match at line breaks; s (dotall) lets . match newlines; u (unicode) enables full Unicode and \p{…} property escapes; y (sticky) anchors matching to a position; and d (indices) records the start and end of each capture. The current flags are shown right after the closing slash, exactly as you would write the literal, so the pattern you build here maps one-to-one onto the code you paste into your project.

The tool goes well beyond matching. In Replace mode you supply a replacement string — with support for $1, $& and named group references — and see a live preview of the transformed text, which is perfect for bulk edits, reformatting and data cleanup. In Split mode the pattern becomes a delimiter and the text is broken into a clean list of pieces, ideal for parsing CSVs, logs and structured strings. A statistics panel summarises each run: total matches, how many are unique versus duplicated, the number of capture groups, the characters tested, the execution time in milliseconds, and a rough complexity score that flags patterns likely to be slow or prone to catastrophic backtracking. Together these turn guesswork into measurement.

To help you start quickly, the tester ships with a library of ready-made patterns for the things people match most often — email addresses, URLs, IPv4 and IPv6 addresses, dates, times, hex colours and more — plus a set tuned for Indian data, including PAN, Aadhaar, GST, IFSC and PIN codes. Load one with a single click, adapt it to your needs, and keep going. A local history remembers your recent patterns so you can jump back to earlier attempts, and you can copy the matched values or export them as TXT, CSV or JSON for documentation, test fixtures or bug reports. Below the tool you will also find a concise regex guide and flags reference so the syntax is always at hand.

Privacy is built in. Unlike some online testers that send your pattern and data to a server, this tool does everything locally: your regex and test text are processed entirely in your browser and never uploaded, there is no account, and nothing about your content is logged or tracked. The only thing stored is an optional local history you can clear at any time. Because it is fully client-side, it also works offline once loaded, and it follows accessibility best practices with keyboard navigation, ARIA labelling, visible focus outlines and high-contrast support. In short, it is a fast, complete, genuinely private regular-expression workbench — powerful enough for serious debugging, approachable enough for learning — that runs entirely on your own machine.

ℹ️ इस टूल के बारे में

ApneSoftware Regex Tester regular expressions लिखने, test करने व debug करने के लिए एक professional, privacy-first workbench है जो सीधे आपके browser में चलता है। एक regular expression — संक्षेप में regex — text वर्णन करने की एक संक्षिप्त pattern भाषा है: यह आपको निश्चित मानों के बजाय नियमों के आधार पर strings खोजने, validate करने, निकालने, replace करने व split करने देती है। Regex एक developer, data analyst, tester या लेखक के लिए सबसे शक्तिशाली उपकरणों में से एक है, पर इसे ग़लत करना भी बेहद आसान है। जो pattern सही लगता है वह चुपचाप edge cases छोड़ सकता है, बहुत ज़्यादा match कर सकता है, या असली input पर विफल हो सकता है। इसका इलाज है तेज़ feedback, और यही यह टूल देता है: एक pattern टाइप करें, कुछ text paste करें, और हर match को तुरंत जलते देखें।

केंद्र में एक live testing engine है जो browser के अपने JavaScript regex engine पर बना है, इसलिए यहाँ दिखते परिणाम वही हैं जो आपके code को मिलेंगे। आपके टाइप करते ही टूल आपका pattern compile करता है, validate करता है, और — यदि यह मान्य है — उसे आपके test string पर चलाकर हर match को जगह पर highlight करता है, बारी-बारी रंगों से ताकि पास-पास के matches अलग दिखें। highlight view के नीचे एक match list हर match को उसकी स्थिति व capture groups के पूरे विवरण के साथ गिनाती है, दोनों numbered ($1, $2) व named। यदि pattern अमान्य है, टूल engine का सटीक error message दिखाता है।

हर regex flag एक click दूर है। g (global) पहला नहीं बल्कि सभी matches ढूँढता है; i case-insensitive बनाता है; m (multiline) ^$ को line breaks पर match कराता है; s (dotall) . को newlines match कराता है; u (unicode) पूर्ण Unicode व \p{…} escapes सक्षम करता है; y (sticky) matching को एक स्थिति पर anchor करता है; और d (indices) हर capture का आरंभ-अंत दर्ज करता है। वर्तमान flags समापन slash के ठीक बाद दिखते हैं, बिल्कुल जैसे आप literal लिखते हैं।

टूल matching से कहीं आगे जाता है। Replace mode में आप एक replacement string देते हैं — $1, $& व named group references के समर्थन के साथ — और रूपांतरित text का live preview देखते हैं, जो bulk edits, reformatting व data cleanup के लिए बढ़िया है। Split mode में pattern एक delimiter बन जाता है और text टुकड़ों की एक साफ़ सूची में टूट जाता है, CSVs, logs व structured strings parse करने के लिए आदर्श। एक statistics panel हर run का सार देता है: कुल matches, कितने unique बनाम duplicate, capture groups की संख्या, tested characters, execution time milliseconds में, और एक मोटा complexity score

जल्दी शुरू करने में मदद के लिए, tester ready-made patterns की एक library के साथ आता है — email addresses, URLs, IPv4 व IPv6 addresses, dates, times, hex colours व अधिक — साथ ही भारतीय data के लिए एक सेट, जिसमें PAN, Aadhaar, GST, IFSC व PIN codes शामिल हैं। किसी को एक click से load करें, अपनी ज़रूरत अनुसार बदलें, और आगे बढ़ें। एक local history आपके हाल के patterns याद रखती है, और आप matched मानों को copy या TXT, CSV या JSON के रूप में export कर सकते हैं।

Privacy अंतर्निहित है। कुछ online testers के विपरीत जो आपका pattern व data server पर भेजते हैं, यह टूल सब कुछ locally करता है: आपका regex व test text पूरी तरह आपके browser में process होते हैं और कभी upload नहीं होते, कोई account नहीं, और आपकी सामग्री के बारे में कुछ भी log या track नहीं होता। केवल एक वैकल्पिक local history store होती है जिसे आप कभी भी साफ़ कर सकते हैं। पूरी तरह client-side होने के कारण यह load होने के बाद offline भी काम करता है, और keyboard navigation, ARIA labelling, दृश्य focus outlines व high-contrast समर्थन के साथ accessibility सर्वोत्तम प्रथाओं का पालन करता है। संक्षेप में, यह एक तेज़, पूर्ण, सचमुच निजी regular-expression workbench है।

📘 Regex Guide

TokenMeaning
.Any character except newline (or any, with the s flag).
\d \w \sA digit, word character, or whitespace (uppercase = negation).
[abc] [^abc]A character in / not in the set; ranges like [a-z].
* + ?Zero-or-more, one-or-more, optional (add ? for lazy).
{2} {2,} {2,5}Exactly, at least, or a range of repetitions.
^ $ \bStart, end, and word-boundary anchors.
( ) (?: )Capturing and non-capturing groups.
(?<name> )Named capture group.
a|bAlternation — match a or b.
(?= ) (?! )Look-ahead: followed / not followed by.
(?<= ) (?<! )Look-behind: preceded / not preceded by.

🎚️ Flags Guide

FlagNameEffect
gGlobalFind all matches, not just the first.
iIgnore-caseMatch letters regardless of case.
mMultiline^ and $ match at each line break.
sDotall. also matches newline characters.
uUnicodeFull Unicode & \p{…} property escapes.
yStickyMatch only at lastIndex.
dIndicesRecord start/end indices of each group.

🧪 Common Examples

MatchesPattern
Email[\w.+-]+@[\w-]+\.[\w.-]+
URLhttps?:\/\/[^\s]+
IPv4\b(?:\d{1,3}\.){3}\d{1,3}\b
Date (YYYY-MM-DD)\d{4}-\d{2}-\d{2}
Hex colour#[0-9a-fA-F]{3,6}\b
PAN (India)[A-Z]{5}[0-9]{4}[A-Z]
Aadhaar (India)\b\d{4}\s?\d{4}\s?\d{4}\b
GSTIN (India)\d{2}[A-Z]{5}\d{4}[A-Z][A-Z0-9]Z[A-Z0-9]
IFSC (India)[A-Z]{4}0[A-Z0-9]{6}
PIN code (India)\b[1-9][0-9]{5}\b

🚀 How To Use

  1. Type a pattern in the slash field, or click a ready-made example to load one.
  2. Toggle the flags you need — start with g for all matches.
  3. Paste your test string; matches highlight instantly with a match list and statistics.
  4. Switch to Replace or Split mode to transform the text.
  5. Copy or export the matches, and reuse a pattern later from history.

❓ Frequently Asked Questions

🛠️ Troubleshooting