Swelıty
Tools for everyone

Free Online Regex Tester

Test, debug, and learn regular expressions instantly. Features a built-in library of common presets, real-time match highlighting, and full flag support.

Regex Library

Select a ready-to-use pattern to get started instantly.

//g

Text to test

ResultWaiting...
Total Matches0
Syntax CheckWaiting...
No matches to display.

Quick Reference

PatternDescription
.Any character except newline
\dDigit (0-9)
\wWord character (a-z, A-Z, 0-9, _)
\sWhitespace
[abc]Character class
^ / $Start / end of line
* / + / ?0+, 1+, 0 or 1
{n,m}Between n and m times
(group)Capture group
(?:group)Non-capturing group
a|bAlternation (a or b)

How to use

  1. Open the Regex Library to load a common preset, or enter your own pattern.

  2. Provide some test text in the main text area.

  3. Enable or disable flags (like global 'g' or case-insensitive 'i').

  4. Observe the highlighted matches in real-time.

  5. Use A− and A+ in the editor's title bar to change the text size, untick Wrap long lines under it to scroll sideways, and use the icons to copy, download or clear the text.

Why use this tool

  • Real-time Matching

    Visually highlight regular expression matches as you type.

  • Regex Library & Reference

    Browse and instantly apply common patterns for URLs, emails, JWTs, and more, or use the quick reference to master regex syntax.

  • Native Performance

    Utilizes your browser's native JavaScript RegExp engine for accurate and fast results.

  • Code editor

    A real code editor with syntax colours, line numbers, undo and redo, adjustable text size and optional line wrapping.

About this tool

The Regex Tester provides an advanced interactive environment to write, test, and debug Regular Expressions. It features a built-in Regex Library with ready-to-use common patterns, a Quick Reference guide to learn regex syntax, and real-time visual highlighting to help developers craft precise extraction rules instantly.

Frequently asked questions

The tool uses the browser's native JavaScript RegExp engine.

Yes, as long as your current web browser supports modern ES2018 JavaScript regex features.

Yes, you can toggle standard flags like global (g), multiline (m), and ignore case (i).

Poorly optimized regex can cause catastrophic backtracking, which might freeze your browser tab, so use with care.

The tool highlights the full match and can also extract and display individual capture groups based on your regex pattern.

No, there are slight syntax differences (e.g., PCRE vs. JavaScript). This tool uses the JavaScript regex engine natively supported by your browser.

Currently, patterns are not saved to an account, so make sure to copy your final working regex before closing the tab.

Yes. Use A− and A+ in the editor's title bar to change the text size, and untick Wrap long lines under the editor to scroll sideways. Both choices are remembered on this device.