ChatGPTB
Tools Blog Top Up
🛠️ Developer Tools

Regular Expression Tester Tool

Real-time match highlighting, count statistics, capture groups display, and built-in cheat sheet for mobile/email/URL/IP etc.

Regular Expression
/ /
Click flags to toggle modifiers · Real-time matching on input
⚠️
Test Text
Matches
0
Capture Groups
0
Text Length
0
Match Highlight
Match results will be highlighted in different colors...
Match Details
No matches yet
⚡ Common Regex Cheat Sheet (Click to Fill)
📱 Mobile Number1[3-9]\d{9}
✉️ Email[\w.+-]+@[\w-]+\.[\w.-]+
🔗 URLhttps?://...
🌐 IPv4((25[0-5]...)\.){3}...
🪪 ID Card[1-9]\d{5}(18|19)...
🔢 Numbers Only\d+
👤 Username[a-zA-Z0-9_-]{4,16}
#️⃣ Number (with Decimal)-?\d+(\.\d+)?
🔢
Token Calculator
GPT Token & Cost Estimator
🧪
Dumbed-down Detector
Test if GPT is dumbed down
🌍
IP Quality Check
Check IP Risk Level
🖌️
JSON Formatter
JSON Beautify, Minify, Validate
⏱️
Timestamp Converter
Unix Timestamp Conversion
📝
Word Count
Chinese/English Characters & Reading Time
Need to Top Up ChatGPT?
Alipay/WeChat Pay · Auto Delivery · 2 Mins
Top Up Now →
What is a Regular Expression?
A Regular Expression (regex) is a mini-language for describing string patterns, used for searching, matching, replacing, and extracting text. It consists of ordinary characters (letters, numbers) and metacharacters (^ $ . * + ? [] () | \), widely used for form validation, log analysis, data cleaning, web scraping, etc. Almost all programming languages have built-in regex engines.
What are some common regex patterns?
Common regex patterns include: mobile number 1[3-9]\d{9}, email [\w.+-]+@[\w-]+\.[\w.-]+、URL https?://[\w./\-?=&%:#]+, IPv4, ID card, numbers only, Chinese characters [\u4e00-\u9fa5], postal code, QQ number, username, password strength, etc. The "Common Regex Cheat Sheet" in this tool includes these templates; click to use them.
Why is my regex not matching?
Common reasons: 1) Forgetting the g flag, resulting in only the first match; 2) Unescaped metacharacters, e.g., to match a literal ., write \.; 3) Mixed Chinese/English brackets, spaces, or full-width characters; 4) Improper use of boundary ^ $ with the m multiline flag; 5) Special character rules inside character sets [] differ from outside. Suggestion: remove ^$ for loose matching first, then tighten to locate the issue.
What do the g/i/m/s flags mean?
g (global) Global matching, finding all instead of just the first;i (ignoreCase) Ignores case, e.g., /abc/i matches ABC;m (multiline) Multiline mode, making ^ and $ match the start and end of each line;s (dotAll) Allows . to match all characters including newlines. Can be combined, e.g., gim