Test a regex against your text in the browser and see every match, capture group and byte offset. Rust regex syntax with linear-time matching.
Runs in your browser — your input is processed on this device and never uploaded.
Rust regex (regex crate). No lookaround or backreferences. Maximum 64 KiB.
Haystack to search. Maximum 20 MiB.
Results appear here.
A regular expression, or regex, is a pattern that finds pieces of text. A regex tester lets you try a pattern against sample text and see what matched, where, and which capture groups filled in, before you put it in code.
This tester runs Rust regex in your browser. That is the regex crate, which matches in linear time. It is not PCRE and not JavaScript's engine.
Many testers use a backtracking engine. A slightly wrong pattern on a long string can then run until the tab freezes. Rust regex compiles to an automaton whose search time grows with the length of the text, not with nested quantifiers. That is why this page says Rust regex up front.
The cost is syntax. You do not get lookbehind, backreferences or possessive quantifiers. If a cheat sheet assumes PCRE, some of its examples will not compile here, and the error tells you so instead of quietly picking a slower engine.
regex101, RegExr and the playgrounds for each language are better when your production engine is PCRE, .NET, Python or JavaScript, because they show that flavor's quirks. A pattern that works here can still fail there, and the other way round.
Case Converter on ToolkitBay rewrites whole identifiers, such as camelCase to snake_case. It does not search. Do not use a regex to parse HTML or JSON either. For structured data a real parser is safer, and JSON Validator or JSON Formatter and Minifier will read JSON properly.
Russ Cox's articles on regular expression matching explain why this class of engine exists. Thompson's construction does not blow up on patterns such as a?a?a?aaa that make backtracking engines crawl.
Offsets are UTF-8 byte positions, not character counts. An emoji can take four bytes, so the numbers will not always match a character index from a JavaScript string.
The pattern is compiled with size, DFA and nesting limits, so a hostile pattern fails at compile time instead of using unbounded memory. Matching stops at 100,000 hits.
The search runs in your browser. The pattern and text are not sent to ToolkitBay's servers.
Find similar tools by category or tag.