---
title: "Regex Tester with Live Highlighting - AllTools"
description: "AllTools highlights every match as you type, visualizes capture groups and substitution, toggling g/i/m/s flags."
canonical_url: "https://tool.warmday.wang/en/dev/regex"
meta:
  author: AllTools
  keywords: "online tools, AllTools, free online tools, developer tools, image tools, PDF tools, text tools, unit converter, no login, browser-based tools"
  "og:description": "AllTools highlights every match as you type, visualizes capture groups and substitution, toggling g/i/m/s flags."
  "og:image": "https://tool.warmday.wang/img/og-cover.png"
  "og:image:alt": "AllTools Logo"
  "og:image:height": "630"
  "og:image:width": "1200"
  "og:title": "Regex Tester with Live Highlighting"
  "twitter:image": "https://tool.warmday.wang/img/og-cover.png"
---

> Index of every page on this site: [llms.txt](https://tool.warmday.wang/llms.txt)

# **Regex Tester**

Test regular expressions online with matching, capture groups, highlighted preview, replacement, and common pattern library.

### **Regex Configuration**

**Regular Expression**

No need to wrap with slashes; enter the pattern directly

**Flags**

**Test String**

**Replace Pattern (optional)**

Supports $1, $2 and other capture group references

### **Common Patterns**

**Email Address**\[a-zA-Z0-9.\_%+-]+@\[a-zA-Z0-9.-]+\\.\[a-zA-Z]{2,}

**URL**https?://\[^\\s]+

**IPv4 Address**\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}

**Phone Number**1\[3-9]\\d{9}

**ID Number**\\d{17}\[\\dXx]

**Date**\\d{4}-\\d{2}-\\d{2}

**Time**\\d{2}:\\d{2}:\\d{2}

**Hex Color**#\[0-9a-fA-F]{6}

**Number**-?\\d+(?:\\.\\d+)?

**Chinese Characters**\[\\u4e00-\\u9fa5]+

### **Match Results**

Please enter a regular expression

### **Usage Guide**

#### **Features**

A regular expression testing tool for real-time regex matching. Enter a regex pattern and test string to automatically compute all matches, showing match positions, match contents, and capture groups with yellow-highlighted match segments. Also supports replacement mode preview and quick pattern insertion.

#### **Steps**

1. Enter a pattern in the "Regular Expression" field (no slashes needed).
2. Select flags as needed (g for global match is default).
3. Paste the text to match in the "Test String" field; match results and highlight preview will display below in real-time.
4. To use replacement, enter the replacement string in the "Replace Pattern" field (supports $1, $2 etc. capture group references).
5. Click any card in "Common Patterns" to quickly insert a preset pattern.

#### **Flag Descriptions**

- `g` - g Global
- `i` - i Ignore case
- `m` - m Multiline
- `s` - s Single line
- `u` - u Unicode
- `y` - y Sticky

#### **Notes**

If g is not selected and multiple matches exist, only the first is returned. Replacement automatically enables the g flag to replace all matches. Zero-width matches (e.g., lookahead) are displayed with position indicators. All matching is done locally in the browser; data is not uploaded to any server.

## **Related tools**

More from the same category · Developer Tools

[**Cron Expression**Visual Cron builder: pick minute-hour-day-month-weekday fields and preview next run times live.](https://tool.warmday.wang/en/dev/cron) [**JSON Formatter**JSON beautify, minify and validate with auto error location for missing brackets and stray commas.](https://tool.warmday.wang/en/dev/json) [**Timestamp Converter**Convert Unix timestamps to dates and back with second/millisecond precision and live current time.](https://tool.warmday.wang/en/dev/timestamp) [**JWT Parser**Split a JWT into header, payload and signature, then base64url-decode claims and expiry without a key.](https://tool.warmday.wang/en/dev/jwt-parser) [**JWT Generator**Issue JWTs with custom header, claims and expiry across HS256, RS256, ES256 for auth-flow testing.](https://tool.warmday.wang/en/dev/jwt-generator) [**UUID Generator**Batch-generate v1, v4 and v5 UUIDs with or without hyphens for keys and distributed IDs.](https://tool.warmday.wang/en/dev/uuid)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://tool.warmday.wang/#organization","name":"AllTools","alternateName":"AllTools - 全能工具箱","url":"https://tool.warmday.wang/","logo":{"@type":"ImageObject","url":"https://tool.warmday.wang/img/logo.png","width":512,"height":512}},{"@type":"WebSite","@id":"https://tool.warmday.wang/en#website","url":"https://tool.warmday.wang/en","name":"AllTools","inLanguage":"en","publisher":{"@id":"https://tool.warmday.wang/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://tool.warmday.wang/en?q={search_term_string}"},"query-input":"required name=search_term_string"}},{"@type":"WebPage","@id":"https://tool.warmday.wang/en/dev/regex#webpage","url":"https://tool.warmday.wang/en/dev/regex","isPartOf":{"@id":"https://tool.warmday.wang/en#website"},"inLanguage":"en","name":"Regex Tester with Live Highlighting","description":"AllTools highlights every match as you type, visualizes capture groups and substitution, toggling g/i/m/s flags."},{"@type":"SoftwareApplication","@id":"https://tool.warmday.wang/en/dev/regex#app","name":"Regex Tester with Live Highlighting","description":"AllTools highlights every match as you type, visualizes capture groups and substitution, toggling g/i/m/s flags.","url":"https://tool.warmday.wang/en/dev/regex","applicationCategory":"DeveloperApplication","operatingSystem":"Web","inLanguage":"en","isPartOf":{"@id":"https://tool.warmday.wang/en/dev/regex#webpage"},"offers":{"@type":"Offer","price":"0","priceCurrency":"CNY"}},{"@type":"BreadcrumbList","@id":"https://tool.warmday.wang/en/dev/regex#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://tool.warmday.wang/en"},{"@type":"ListItem","position":2,"name":"Developer Tools","item":"https://tool.warmday.wang/en/dev"},{"@type":"ListItem","position":3,"name":"Regex Tester","item":"https://tool.warmday.wang/en/dev/regex"}]}]}
```

## Sitemap

See the full [sitemap](https://tool.warmday.wang/sitemap.md) for all pages.
