Regex Tester
Testa espressioni regolari in tempo reale con highlighting e gruppi di cattura.
Risultati
Come utilizzare Regex Tester Online
Insert Regex Pattern
Write your regular expression in the "Pattern Regex" field. The pattern is compiled in real-time and any syntax errors are shown immediately below the field.
Select flags
Activate or deactivate available flags: 'g' for all matches, 'i' to ignore case, 'm' for multi-line mode, 's' for point matching including newlines, 'u' for Unicode support.
Insert Test Text
Paste or type the text you want to test the regex on in the "Test Text" field. Matches are highlighted automatically as soon as you type.
Choose match or replace method
Use the "Match" mode to view all found matches with their respective capture groups and positions. Switch to the "Replace" mode to replace matches with a custom text using $1 and $2 for groups.
Use common patterns or Cheat Sheet
Click on one of the pre-defined patterns in the side bar (Email, URL, Tax Code, etc.) to load it instantly. Open the Cheat Sheet to insert regex tokens with a single click without having to remember them.
Suggerimenti
- Use the button "Example" to load a pre-set regex with email addresses and see how groups capture works immediately.
- To test a pattern with a backslash, remember that in JavaScript the backslash is doubled: write \\d instead of \d in the pattern field.
- Interactive cheat sheet allows you to insert tokens like \d, \w or
Domande frequenti
How do you write a regular expression online without installing anything?
With the Regex Tester by federicocalo.dev, you can paste your pattern and test text directly. The result appears in real-time, with matches highlighted, numbered capture groups, and execution time in milliseconds.
How do capture groups work in regular expressions?
Groups of capture are created with rounded parentheses, for example (\w+). In Match mode, this tester shows the value of $1, $2, etc. for every match found. In Replace mode you can use $1, $2 in the substitution string to reuse captured parts.
What does the flag "g" mean in JavaScript regular expressions?
The flag "g" (global) makes the regex search for all matches in the text, not just the first one. Without this flag, the search stops at the first occurrence. With the flag active, the tester shows the total count and position of every match.
How can I do a case-insensitive search with regular expressions?
Activate the 'i' flag (case insensitive): in this way, the pattern treats both uppercase and lowercase letters equally. For example, the pattern '[a-z]+' with the 'i' flag will match "hello", "HELLO", and "Hello".
What is the purpose of the multiline "m" flag in regular expressions?
Be concise - keep similar length. The flag "m" (multiline) changes the behavior of ^ and $ which match at the start or end of every line instead of the entire string. Useful when text contains newlines and you want to find patterns at the beginning or end of each line.