---
title: "Online Regex Tester & Debugger — Test, Highlight & Replace | Regex Tester"
description: "Test, debug, and replace regular expressions online with live highlighting and capture groups. Runs 100% in your browser — nothing is uploaded."
canonical_url: "https://regex.travis-tool.cn/"
meta:
  "og:description": "Test, debug, and replace regular expressions with the native JavaScript engine. 100% client-side execution."
  "og:title": "Online Regex Tester & Debugger"
---

> Index of every page on this site: [llms.txt](https://regex.travis-tool.cn/llms.txt)

Test String

Regular Expression

//

Enter the pattern only — the slashes are visual delimiters.

## Highlighted matches

Read-only preview

The highlighted preview appears here.

## Match Results

**No matches found**

Enter a pattern and some text to see matches here.

Replacement

Backreferences: $1, $&, $\<name>. The result below updates as you type.

## Replace Result

0 replacements

```
The replaced text appears here.
```

## **Regex Cheat Sheet**

Quick reference for the syntax supported by the native JavaScript engine.

### **Character classes**

| `.` | Any character except newline (unless the s flag is set) |
| --- | --- |
| `\d` | Digit (0-9) |
| `\w` | Word character (letter, digit, underscore) |
| `\s` | Whitespace |
| `[abc]` | Any one of a, b, or c |
| `[^abc]` | Any character except a, b, or c |

### **Quantifiers**

| `*` | Zero or more |
| --- | --- |
| `+` | One or more |
| `?` | Zero or one |
| `{3}` | Exactly three |
| `{2,5}` | Between two and five |
| `*?` | Lazy version of \* |

### **Anchors and boundaries**

| `^` | Start of input, or of a line with the m flag |
| --- | --- |
| `$` | End of input, or of a line with the m flag |
| `\b` | Word boundary |
| `\B` | Not a word boundary |

### **Groups and references**

| `(abc)` | Capturing group |
| --- | --- |
| `(?:abc)` | Non-capturing group |
| `(?<name>abc)` | Named capturing group |
| `\1` | Backreference to group 1 |
| `a\|b` | Alternation (a or b) |
| `(?=abc)` | Positive lookahead |
| `(?!abc)` | Negative lookahead |

## **How to use this regex tester**

1. **1. Add your test string.** Paste or type the text you want to inspect. Use “Load sample text” to try the tool with a ready-made example.
2. **2. Enter a pattern and pick flags.** Type the expression without slashes. Toggle g, i, m, and s to change matching behaviour.
3. **3. Review every match.** The results list shows the matched text, its index, and every capture group. Click a result to scroll the highlighted preview to that match.
4. **4. Build a replacement.** Use $1, $&, or $\<name> to reference captured text. The result updates as you type, and you can copy or download it as a text file.
5. **5. Save useful patterns.** History keeps the last 20 contexts in your browser only. Restore an entry to bring back the pattern, flags, test string, and replacement.

Everything runs locally. No account, no server, no upload.

## **Frequently asked questions**

<dl>

<dt>**Is my data sent to a server?**</dt>
<dd>No. Every regular expression, test string, replacement, and history entry stays in your browser. The page runs entirely client-side and never uploads your input.</dd>

<dt>**Which regular expression engine does this tool use?**</dt>
<dd>It uses the built-in JavaScript RegExp engine of your browser, so matches, capture groups, and replacements behave exactly like they do in your own code.</dd>

<dt>**What do the g, i, m, and s flags mean?**</dt>
<dd>g finds every match instead of the first one, i ignores letter case, m makes ^ and $ match line boundaries, and s lets the dot match newline characters.</dd>

<dt>**Why does my pattern match empty strings?**</dt>
<dd>Patterns such as a* or .* can match zero characters. The tester advances the search position safely so the browser never freezes, and zero-width matches are still listed.</dd>

<dt>**Where is my history stored?**</dt>
<dd>In your browser local storage, limited to the 20 most recent entries. It never leaves your device. If storage is disabled, the tester keeps working without saving history.</dd>

<dt>**Can I use the replacement syntax from JavaScript?**</dt>
<dd>Yes. $1, $2, $&amp; and $&lt;name&gt; work exactly as in String.prototype.replace. In addition, \n and \t in the replacement become a newline and a tab.</dd>

<dt>**Does this tool require an account?**</dt>
<dd>No. There is no sign-up, no login, and no database. Open the page and start testing immediately.</dd></dl>

```json
{"@context":"https://schema.org","@type":"WebApplication","inLanguage":"en","name":"Regex Tester & Replacer","url":"https://regex.travis-tool.cn/","applicationCategory":"DeveloperApplication","operatingSystem":"Any","browserRequirements":"Requires JavaScript. Runs entirely in the browser.","description":"Test, debug, and replace regular expressions online with the native JavaScript engine. All processing happens locally in your browser.","offers":{"@type":"Offer","price":"0","priceCurrency":"USD"}}
```

```json
{"@context":"https://schema.org","@type":"FAQPage","inLanguage":"en","mainEntity":[{"@type":"Question","name":"Is my data sent to a server?","acceptedAnswer":{"@type":"Answer","text":"No. Every regular expression, test string, replacement, and history entry stays in your browser. The page runs entirely client-side and never uploads your input."}},{"@type":"Question","name":"Which regular expression engine does this tool use?","acceptedAnswer":{"@type":"Answer","text":"It uses the built-in JavaScript RegExp engine of your browser, so matches, capture groups, and replacements behave exactly like they do in your own code."}},{"@type":"Question","name":"What do the g, i, m, and s flags mean?","acceptedAnswer":{"@type":"Answer","text":"g finds every match instead of the first one, i ignores letter case, m makes ^ and $ match line boundaries, and s lets the dot match newline characters."}},{"@type":"Question","name":"Why does my pattern match empty strings?","acceptedAnswer":{"@type":"Answer","text":"Patterns such as a* or .* can match zero characters. The tester advances the search position safely so the browser never freezes, and zero-width matches are still listed."}},{"@type":"Question","name":"Where is my history stored?","acceptedAnswer":{"@type":"Answer","text":"In your browser local storage, limited to the 20 most recent entries. It never leaves your device. If storage is disabled, the tester keeps working without saving history."}},{"@type":"Question","name":"Can I use the replacement syntax from JavaScript?","acceptedAnswer":{"@type":"Answer","text":"Yes. $1, $2, $& and $\u003Cname> work exactly as in String.prototype.replace. In addition, \\n and \\t in the replacement become a newline and a tab."}},{"@type":"Question","name":"Does this tool require an account?","acceptedAnswer":{"@type":"Answer","text":"No. There is no sign-up, no login, and no database. Open the page and start testing immediately."}}]}
```

## Sitemap

See the full [sitemap](https://regex.travis-tool.cn/sitemap.md) for all pages.
