Regex Tester
Test regular expressions against text in real time
Enter a pattern and flags, then see every match highlighted in your text instantly — with a list of matches and capture groups, all in your browser.
About the regex tester
A regular expression (regex) is a compact pattern language for searching, matching, and replacing text. This tester compiles your pattern against the sample text on every keystroke and highlights every match inline, so you can fine-tune a pattern and see the result immediately.
When the global (g) flag is on, all matches are found; without it, only the first match is returned. Capture groups are listed beneath each match so you can inspect what each parenthesized group captured.
Flags
- g — find all matches, not just the first.
- i — case-insensitive matching.
- m — ^ and $ match line beginnings and ends.
- s — dot (.) matches newlines too.
- u — treat the pattern as Unicode.
- y — sticky matching at the current position.
How to use the regex tester
Enter your pattern
Type a regular expression in the pattern field — no leading or trailing slashes needed.
Toggle flags
Switch on the flags you need, such as g for all matches or i for case-insensitive.
Add test text & read matches
Paste the text to test against. Matches highlight live and a list of matches and groups appears below.
Frequently asked questions
Do I need to wrap my pattern in slashes?
What are capture groups?
Why is only one match highlighted?
What does an invalid pattern error mean?
Is my text sent to a server?
Explore more utilities
More like this
Other utilities
- Word UnscramblerFind every word from jumbled letters
- Anagram SolverFind anagrams of any word
- Word CounterCount words, characters & sentences
- Word FinderFind words matching a pattern
- Random Word GeneratorGenerate random dictionary words
- Character CounterCount characters with & without spaces
- Case ConverterConvert text to upper, lower, title & more
- Text CleanerRemove extra spaces, blank lines & junk
- Remove Duplicate LinesDelete repeated lines from any text
- Sort LinesSort lines alphabetically or numerically
- Text ReverserReverse text, words or characters
- Find & ReplaceFind and replace text with options
- Text DiffCompare two texts and highlight differences
- Slug GeneratorTurn any text into a URL-friendly slug
- Text to ListConvert text into a formatted list
- Percentage CalculatorCalculate percentages instantly
- Percentage Change CalculatorMeasure increase or decrease between values
- Discount CalculatorFind sale price & savings
- Tax CalculatorAdd or remove sales tax & VAT
- Tip CalculatorCalculate tips & gratuity
- Split Bill CalculatorSplit a bill & tip across people
- Ratio CalculatorSimplify & solve ratios
- Fraction CalculatorAdd, subtract, multiply & divide fractions
- Average CalculatorMean, median, mode & range
- Standard Deviation CalculatorVariance & standard deviation of a data set
- Age CalculatorCalculate age from any birthdate
- Date Difference CalculatorAdd to dates or find date differences
- Time Duration CalculatorCalculate time between two times
- Interest CalculatorSimple & compound interest in one tool
- Loan/EMI CalculatorMonthly EMI, interest & total payable
- Unit ConverterConvert length, weight & temperature
- Time ConverterConvert between time units
- Data Storage ConverterConvert bits, bytes, KB, MB, GB & TB
- Data Transfer ConverterConvert bit/s, Mbit/s, MB/s & GB/s
- Pressure ConverterConvert pascal, bar, psi & atm
- Energy ConverterConvert joules, calories, kWh & BTU
- Number/Base ConverterConvert binary, octal, decimal & hex
- Time Zone ConverterConvert times between world time zones
- Power ConverterConvert watts, kilowatts, horsepower & BTU/h
- Fuel Economy ConverterConvert MPG, L/100km & km/L
- Password GeneratorCreate strong, secure random passwords
- QR Code GeneratorTurn any link or text into a QR code
- Random Number GeneratorGenerate random numbers in any range
- Lorem Ipsum GeneratorGenerate placeholder Lorem Ipsum text