Insert a tested regex for Chinese mobile numbers, national ID cards, or vehicle plates directly from VS Code without memorizing the pattern.
Use the web app or command-line tool to browse and copy common regex patterns for email, URL, IP address, or date validation.
Search the extension's catalog with a keyword like 'phone' or 'date' from the VS Code command palette and paste the result instantly.
Any-rule is a collection of 84 common regular expressions, packaged as a VS Code extension with support for several other tools as well. A regular expression is a pattern that tells a program what a piece of text should look like, such as what a valid phone number, email address, or date format looks like. Writing these patterns correctly is tedious and error-prone, so having a pre-tested library of them saves developers time. The VS Code extension offers three ways to insert a pattern into your code. You can open the command palette with F1 and type a keyword like "phone" or "date" to search the list. You can right-click anywhere in your editor to open the full catalog. Or you can type the shortcut @zz inline while writing code and pick from the dropdown that appears. Once you select a pattern, VS Code inserts it at the cursor. The extension also includes a visual explanation feature. After selecting a pattern, a prompt lets you open a diagram showing how each part of the expression works, powered by the regexper.com tool. This makes the patterns easier to read and verify before using them. Beyond VS Code, the same collection is available as a web app, a JetBrains IDEA plugin, an Alfred Workflow for macOS, a command-line tool, and a uTools plugin. These are maintained by separate contributors rather than the original author. The patterns in the collection cover Chinese-specific formats like national ID card numbers, vehicle license plates (including new-energy plates), Chinese mobile phone numbers per official carrier data, and Chinese company credit codes. It also includes general formats like email addresses, URLs, IP addresses, dates, and file paths for both Windows and Linux systems. New patterns can be contributed via pull request by adding them to the rules file and running the included tests.
← any86 on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.