KT。
Korelyy Toolskorelyy.com

Sign In / Sign Up

Welcome back — sign in to sync your favorites

Don't have an account?

By continuing you agree to our Terms and Privacy Policy

About Us

Meet the Korelyy team & mission

Privacy Policy

Our privacy commitment

Data Processing & Disclaimer

Data rules & disclaimer

Cookie Settings

Manage cookie preferences

Advertising & Support

Contact Us

Compliance

Tool verification

Blog

Tutorials, SEO guides & use cases

2026 Korelyy. All rights reserved.

My Toolbox

0 saved tools

No saved tools yet

Click the star button on tool cards to save them

History

0 records

No history yet

Your tool usage will be recorded automatically

My Profile

Manage your account info and preferences

?
-Free
-

Basic Info

-
Email & Password
Free
-

Security

This email was registered with a different method
← Back to all posts
RegexPracticalCode Snippets

10 Practical Regex Patterns Every Engineer Should Bookmark (2026 Playbook)

10 copy-paste regex patterns + JavaScript/Go/Python snippets: Chinese mobile + ID card, UUID v4/v7, ISO 8601 timestamps, email RFC 5322 strict, CSV row parser, Base64 detector, Markdown link extractor, SemVer, 信用卡 Luhn pre-check, password strength. All live-tested against Korelyy Regex Tester with explanation trees.

K
By Korelyy Team
July 3, 2026·11 min Read

1. Quick Reference: 10 Patterns With Explanations

#1 中国移动号码 (精确 2024-号段)
/^1(3[0-9]|4[014-9]|5[0-3,5-9]|6[2567]|7[0-8]|8[0-9]|9[0-3,5-9])\d{8}$/

#2 UUID v4
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/

#3 UUID v7
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/

#4 RFC 5322 "strict" email (usable in production)
/^[a-zA-Z0-9_!#$%&'*+/=?`{|}~^.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,63}$/

#5 ISO 8601 timestamp (with Z or offset)
/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,6})?(Z|[+-]\d{2}:\d{2})$/

#6 Semantic Versioning (https://semver.org)
/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/

#7 18-digit Chinese ID Card (GB11643-1999 checksum stage-1 regex, please validate checksum separately)
/^[1-9]\d{5}(18|19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}[0-9Xx]$/

#8 Base64 headerless blob detector
/^[A-Za-z0-9+/]{4}*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/

#9 Extract Markdown links: group 1 = label, group 2 = href
/\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/g

#10 Password strength (min 12 chars + upper + lower + digit + symbol)
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]).{12,128}$/

2. Anti-Patterns: 3 Regex Mistakes That Blew Up Production

⛔ Do NOT use email regexes "loose" for signup. A loose /^[^\s@]+@[^\s@]+\.[^\s@]+$/ accepts "[email protected]" which routes nowhere. Always use pattern #4 plus MX-record lookup in the backend.
🎯 Paste Any of the 10 Regexes + Test Real Samples (Highlighted Parse Tree) →→

FAQ: Frequently Asked Questions

What are the most useful regex patterns?

Top patterns: email validation, phone numbers, URLs, date formats, IP addresses, hex colors, credit cards, HTML tags.

How do I test regex patterns?

Use Korelyy's Regex Tester with live matching, highlighting, and group display in real-time.

What regex flavor should I use?

JavaScript/ECMAScript for web development — most common and compatible with Node.js, browsers, and text editors.

Put the tutorial patterns to work instantly

Regex Tester
→
Password Generator
→
Base64 Tool
→
URL Encode Decode
→
Text Counter
→
Try 100+ ready templates in Korelyy Toolbox →
☕ Support KorelyyIf this tool helped you, buy me a coffee

Contents

  • 1. Quick Reference: 10 Patterns With Explanations
  • 2. Anti-Patterns: 3 Regex Mistakes That Blew Up Production
  • FAQ: Frequently Asked Questions