Instalar o ZYBERMART

Abra qualquer ferramenta pela tela inicial ou pelo Dock, em uma janela própria. As ferramentas que você já usou também funcionam offline.

Testador de regex

Teste expressões regulares com destaque das correspondências ao vivo, grupos de captura, flags e prévia de substituição.

/ / g

#MatchIndexGroups

Regex cheat sheet

PatternMatches
.Any character except a newline
\d \w \sDigit, word character (letter, digit, _), whitespace
[abc] [^abc] [a-z]One of a, b or c; anything but them; a range
* + ?0 or more, 1 or more, 0 or 1 (add ? to make lazy)
{2} {2,} {2,5}Exactly 2, at least 2, between 2 and 5
^ $ \bStart of text/line, end of text/line, word boundary
(…) (?:…) (?<name>…)Capture group, non-capturing group, named group
a|ba or b
(?=…) (?!…) (?<=…)Lookahead, negative lookahead, lookbehind

Useful patterns

  • Email address (simple): [\w.+-]+@[\w-]+\.[\w.-]+
  • URL: https?:\/\/[^\s]+
  • Date YYYY-MM-DD: \d{4}-\d{2}-\d{2}
  • Hex color: #(?:[0-9a-fA-F]{3}){1,2}\b
  • Extra spaces: {2,} (replace with one space)

Frequently asked questions

Which regex flavor does this tester use?

It uses JavaScript (ECMAScript) regular expressions, the same engine as your browser and Node.js. Most syntax is shared with Python, Java, C# and PCRE, but features such as lookbehind, named groups and Unicode classes can differ slightly between languages.

What do the flags mean?

g finds all matches instead of just the first, i ignores case, m makes ^ and $ match at line breaks, s lets . match newlines, u enables full Unicode support, and y (sticky) only matches at the current position.

How do I use capture groups in the replacement?

Use $1, $2 and so on for numbered groups, $<name> for named groups, and $& for the whole match. For example, replacing (\w+)@(\w+) with $2 at $1 swaps the two parts.

Why does my pattern stop with “took too long”?

Some patterns, especially nested quantifiers like (a+)+, can take exponential time on certain input. The tester runs your regex in a background worker and stops it after a second, so the page never freezes. Simplify the pattern to fix it.

Entrar no ZYBERMART

Tenha seus currículos, faturas, flashcards, notas e ferramentas salvas em todos os seus dispositivos. É grátis, e as ferramentas funcionam igual sem conta.

ou

Não precisa de senha. Ao entrar, você concorda com os termos; veja como tratamos seus dados na política de privacidade.

Sua conta

Ao sair, uma cópia do seu trabalho fica neste navegador. Em um computador compartilhado, limpe os dados do navegador depois.

O que você quer criar?

Designs

Redes sociais

Documentos

Estudos

Editar

Ver todas as 282 ferramentas