TL;DR: Free curated regex library: 14 battle-tested patterns for CN mobile/ID/plates (incl. new-energy)/credit codes, email, URL, IPv4/IPv6, dates, and postcodes — each with usage notes and samples, copy or jump to the online tester.
This tool runs entirely in your browser. Open DevTools → Network panel and search your input — it appears in no request.
Usage Guide
"What is the regex for a Chinese phone number" is a question every CJK developer has searched — and half the answers online are stale (still allowing the 12x prefix) or too loose (\d{11} accepts anything starting with 1). This library ships 14 battle-tested patterns verified against samples and counter-samples: CN mobile, resident ID, plates (standard + new-energy), Unified Social Credit Codes, plus email/URL/IPv4/dates and friends. Copy in one click or jump into the online tester to verify live.
1. Notes on the China-format trio
The mobile pattern ^1[3-9]\d{9}$ covers every allocated prefix since MIIT retired 12x — fine for form pre-checks. The new-energy plate pattern encodes the position rules (D/F leads small, trails large, excluded elsewhere), the same logic as this site’s plate validator. The ID pattern only checks shape — the MOD 11-2 check digit is beyond regex; use the validator for strict checks. The credit-code pattern uses the 31-char alphabet, and its mod-31 check digit is likewise regex-proof.
2. Using them in projects
Embed in both client and server validation (client for UX, server for safety). Trim the long ones (URL/IPv6) for readability as needed; before shipping, run every pattern against real samples and hostile inputs (empty, overlong, fullwidth digits) in the tester.
Related Tools
Related Articles
Regex Not Matching? Troubleshoot These 6 Common Pitfalls
How to troubleshoot when a regex doesn't match or matching fails? This article walks through 6 common pitfalls — greedy quantifiers, missing flags, unescaped special chars, lookaround assertions, newline handling, and Unicode properties — with before/after examples to help you quickly locate regex debugging issues.
Regex Matches Nothing / Greedy .* Swallows Results — How to Fix
Online regex test matches nothing, or greedy .* eats too much, or groups capture nothing? Explains greedy vs lazy, escaping special chars, and anchors — with a step-by-step debug using our regex tester.
Online Regex Explainer: Visualize and Understand Regular Expressions
Learn how to parse and understand regular expressions. Understand regex syntax structure, matching principles, and how to use visualization tools to analyze complex patterns.