Regex Tester Online - Free Regular Expression Testing Tool
FREE TOOL

Regex Tester Online

Real-time matching highlight, capture group extraction, common regex cheat sheet, 100% client-side

🔒 100% Client-side · Your data never leaves your browser
Regular Expression
/ /
Test Text
Match Results
Common Regex Cheat Sheet (click to use)

Email Address

[\w.-]+@[\w.-]+\.\w+

Match standard email format

Phone Number

1[3-9]\d{9}

China mobile phone number

URL

https?://[\w./?=&%-]+

Match HTTP/HTTPS links

IP Address

(\d{1,3}\.){3}\d{1,3}

IPv4 address

ID Card Number

[1-9]\d{5}(19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}[\dXx]

18-digit Chinese ID

Date YYYY-MM-DD

\d{4}-\d{2}-\d{2}

Standard date format

Chinese Characters

[\u4e00-\u9fa5]+

Match Chinese text

Hex Color

#[0-9a-fA-F]{6}

CSS color value

Postal Code

[1-9]\d{5}

China postal code

QQ Number

[1-9][0-9]{4,11}

5-12 digit QQ number

Float Number

-?\d+\.?\d*

Number with decimals

HTML Tag

<(\w+)[^>]*>.*?</\1>

Match HTML tag pairs

Related Tools

📖 Regex Tester Guide

What is a Regular Expression?

A Regular Expression (Regex) is a text pattern matching tool used for searching, replacing, and extracting content from strings that match specific rules. It is widely used in form validation, log analysis, data cleaning, and web scraping data extraction, making it an essential skill for developers and data analysts.

Key Features

Common Metacharacters Reference

Frequently Asked Questions

Why doesn't my regex work in other languages?

Different programming languages have different regex engines. This tool uses JavaScript's regex engine, which supports most PCRE syntax but lacks some advanced features (e.g., named capture groups have different syntax across languages). If you need to use it in Python/Java/Go, refer to the respective language's documentation.

What do the g, i, m flags mean?

g (global) finds all matches instead of just the first; i (ignore case) makes /a/i match both A and a; m (multiline) makes ^ and $ match the start and end of each line rather than the entire text; s (dotAll) makes . match newlines; u (unicode) enables Unicode mode.

What is a capture group?

A capture group is a part of the regex enclosed in parentheses (). The regex engine saves the content matched by each capture group separately. For example, (\\d{4})-(\\d{2})-(\\d{2}) has three capture groups capturing year, month, and day respectively. In replacement operations, you can reference them with $1, $2, $3.

Is my data uploaded to a server?

No. This tool runs 100% locally in your browser. All regex matching and text processing happens on your device. No data is uploaded to any server, fully protecting your privacy.

How do I use regex in code?

JavaScript: const re = /pattern/gi; text.match(re). Python: import re; re.findall(r'pattern', text). Java: Pattern.compile("pattern").matcher(text). Go: regexp.MustCompile("pattern").FindAllString(text, -1).