finds.dev← search

// the find

any86/any-rule

★ 8,642 · TypeScript · MIT · updated Jul 2024

🦕 常用正则大全, 支持web / vscode / idea / Alfred Workflow多平台

A Chinese-language collection of about 84 regular expressions for everyday validation work, covering phone numbers, national ID cards, license plates, IMEI and social credit codes. The same rule list ships as a web page, a VS Code extension, and ports for IntelliJ, Alfred and uTools. Aimed at developers building software for the Chinese market.

The China-specific validators are the reason to look: first- and second-generation ID card patterns with the check digit, new-energy and ordinary license plate formats, and unified social credit codes. These are hard to find assembled in one place. One RULES.js file drives the web page, the VS Code extension and the generated README, so an entry added once reaches every surface. Some entries say where they came from and when to use them: the bank card pattern cites WeChat Pay's docs, and the phone number entries are split into strict and loose versions, with the loosest recommended for numbers that must receive SMS.

Some patterns do not do what their labels say. The province list is written as ^浙江|上海|...|澳门$, so the anchors bind only the first and last alternatives and the rule matches any string containing 上海. The subnet mask rule has the same alternation bug. Several patterns are too loose for the input they claim to check. The URL pattern has no end anchor, so it matches the start of almost any string. The bank card pattern is only a digit count with no Luhn check. The last push was July 2024, and the phone segment note still cites a 2019 MIIT list, so treat the segment data as a starting point rather than current.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →