Regex Tester

/ /
Flags: g global   i case-insensitive   m multiline   s dotAll   u unicode
Enter a pattern to start
Matches will appear here.

How to Use

  1. Enter a regular expression in the pattern field (between the / delimiters).
  2. Set flags as needed (g=global, i=case-insensitive, m=multiline, etc.).
  3. Type or paste your test string in the Test String field.
  4. Matches are highlighted in real-time. Click the Matches tab to see each match and its captured groups.
  5. Use the Replace tab to preview string replacements with your regex.

Features

Live Match HighlightingMatches are highlighted as you type — no button needed.
Captured GroupsSee all captured groups for every match, numbered clearly.
Replace PreviewPreview the result of replace operations before using them in code.
Regex CheatsheetBuilt-in cheatsheet for quick reference of common patterns.

Use Cases

FAQ

What regex flavor does this tool use?
This tool uses JavaScript's built-in RegExp engine, which supports the ECMAScript (ES2022+) regex flavor, including named capture groups, lookaheads, and lookbehinds.
How do I use capturing groups in the Replace field?
Use $1, $2, $3 etc. to reference captured groups. For example, if your regex is (\w+)\s(\w+), you can use $2 $1 to swap two words.
Why is my regex not matching?
Common causes: missing the g flag for global matching, forgetting to escape special characters (., *, +, ?, (, ), [, ], {, }, ^, $, |, \\), or case sensitivity (add the i flag to ignore case).
Is my test data sent to any server?
No. All regex matching runs entirely in your browser using JavaScript. No data leaves your device.

More Free Tools

🎨 Creative

Team SplitterRPG Name GeneratorColor Palette GeneratorCatchphrase GeneratorFortune GeneratorPersonality Type QuizGraduation Message GeneratorNickname GeneratorNew Year Goals GeneratorBusiness Card Design GeneratorSchool Entry Message GeneratorAI Prompt GeneratorBento Recipe GeneratorSpring SNS Caption GeneratorYojijukugo GeneratorSpring Welcome Message GeneratorSpring Haiku GeneratorWhite Day Message GeneratorBlood Type x Zodiac CompatibilityAI Picture Book Story GeneratorGolden Week Travel Budget PlannerWelcome/Farewell Party Game GeneratorJapanese Proverbs & Quotes GeneratorGraduation Speech GeneratorToday's Lucky ColorManga/LN Title GeneratorGraduation Album Message GeneratorThank-You Letter GeneratorShop Name GeneratorCherry Blossom Viewing Plan GeneratorSelf-Introduction GeneratorBaby Name GeneratorPast Life Fortune GeneratorNew Employee Type DiagnosisCeremony Outfit SuggestionCherry Blossom Fate DiagnosisClub Activity Recruitment GeneratorProject & Team Name GeneratorNew Year SNS Profile GeneratorHanami Bingo Card GeneratorBlog Title GeneratorFlower Language GeneratorChildren's Day Hero Type DiagnosisNew Year Challenge Declaration Card GeneratorPoem & Poetry GeneratorLove Type Diagnosis GeneratorMother's Day Gift DiagnosisBrainstorming GeneratorFather's Day Message Card GeneratorWedding Speech GeneratorIcebreaker Game GeneratorChildren's Day Message Card GeneratorBirthday Message GeneratorGW Family Game GeneratorGW Drive Plan GeneratorChildren Day Craft Idea GeneratorEarly Summer Fashion Type DiagnosisBBQ Menu GeneratorName Compatibility FortuneSports Day Cheer Message GeneratorChildren's Day Party Recipe GeneratorOshi-katsu Fortune GeneratorFather's Day Gift Diagnosis GeneratorSNS Hashtag GeneratorRiddle & Quiz GeneratorX Profile Bio GeneratorDinner Menu Generator