dev/inspector

Regex Tester & Explainer - Free & Instant | Smocky

What is Regex?

A regular expression describes a pattern for finding text or checking its shape, such as finding numbers or codes with a particular prefix.

A Pattern is the condition, a Test string is the text being tested, and a Match is text or a position that satisfies that condition. With Pattern \d+, Flags g, and Test string Order 123, item 45, the Matches are 123 and 45. Here \d means a digit from 0 to 9, + means one or more, and g continues searching for further Matches.

A Match can be only part of the Test string. For example, ^\d+$ checks that the whole string contains only digits: ^ marks the start and $ the end, and multiline mode changes which line boundaries they match.

This Tool uses JavaScript regular expressions; syntax in other languages can differ.

Frequently asked questions

Which regular-expression syntax does this Tool use?

This Tool evaluates JavaScript regular expressions using your browser’s native RegExp. Enter raw Pattern source without slash delimiters or trailing Flags. Syntax in Python, PCRE, .NET, and other engines may behave differently.

Which Flags can I use?

The supported Flags are d, g, i, m, s, u, v, and y when your browser supports them. Repeating a Flag, entering an unknown Flag, or using u and v together produces an error. The g Flag searches for further Matches, while y requires a Match at the current position.

What does Empty match mean?

An Empty match is a valid zero-length Match: the Pattern matched a position without consuming characters. The highlighted Test string marks each position, and the Match list shows its zero-based UTF-16 span.

What are the input and evaluation limits?

Patterns are limited to 10,000 UTF-16 code units, Test strings to 100,000, and results to 1,000 Matches. A Worker gets one second after readiness to evaluate and five seconds to start. Inputs are rejected or evaluation is stopped at the limit; nothing is silently truncated.

Send feedback

About Smocky

Send this feedback to Smocky via Cloudflare, a third-party service. Only the feedback you enter is included, along with your browser information. Your tool inputs and results are never attached. Please do not include passwords or other sensitive information. Privacy policy

Feedback is unavailable right now. Your draft is still here.