Regex Library
A collection of commonly used regular expression patterns. Search and copy to use right away!
Basic Email
기본 이메일 형식
^[\w\.-]+@[\w\.-]+\.\w+$user@example.comRFC 5322 Email
RFC 5322 표준 이메일
^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$user.name+tag@example.co.krURL
HTTP/HTTPS URL
HTTP/HTTPS URL
^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$https://www.example.com/path?query=valueDomain Name
도메인 이름
^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$example.comPhone
Korean Phone
한국 휴대폰 번호
^01[0-9]-?[0-9]{3,4}-?[0-9]{4}$010-1234-5678US Phone
미국 전화번호
^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$(123) 456-7890International Phone
E.164 국제 전화번호
^\+?[1-9]\d{1,14}$+821012345678Date & Time
Date (YYYY-MM-DD)
ISO 8601 날짜 형식
^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$2024-01-15Time (HH:MM:SS)
24시간 시간 형식
^([01]\d|2[0-3]):([0-5]\d):([0-5]\d)$14:30:45Date (DD/MM/YYYY)
DD/MM/YYYY 형식
^(0[1-9]|[12]\d|3[01])\/(0[1-9]|1[0-2])\/\d{4}$15/01/2024Numbers
Integer
정수
^-?\d+$-123Decimal
소수
^-?\d*\.?\d+$123.45Positive Integer
양의 정수
^[1-9]\d*$123Credit Card
신용카드 번호 (Visa, MasterCard, Amex)
^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|3[47][0-9]{13})$4111111111111111Password
Strong Password
최소 8자, 대소문자, 숫자, 특수문자 포함
^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$Abcd1234!Medium Password
최소 6자, 영문+숫자
^(?=.*[a-zA-Z])(?=.*\d)[a-zA-Z\d]{6,}$Abcd1234Code
IPv4 Address
IPv4 주소
^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$192.168.1.1IPv6 Address
IPv6 주소
^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$2001:0db8:85a3:0000:0000:8a2e:0370:7334Hex Color
HEX 색상 코드
^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$#FF5733HTML Tag
HTML 태그
<[^>]+><div class="test">Korean
Hangul Only
한글만
^[가-힣]+$한글Korean Name
한국 이름 (2-4자)
^[가-힣]{2,4}$홍길동Korean ID (RRN)
주민등록번호
^\d{6}-?[1-4]\d{6}$901231-1234567Categories
📧 Email
Regex patterns for email address validation
🌐 URL
Web address and domain validation patterns
📞 Phone
Phone number format patterns for various countries
📅 Date & Time
Date and time format validation patterns
🔢 Numbers
Numbers, integers, decimals, credit card numbers, etc.
🔐 Password
Password strength validation patterns
💻 Code
Code-related patterns like IP addresses, color codes, HTML tags
🇰🇷 Korean
Korean patterns including Hangul, Korean names, resident registration numbers
How to Use
- Select Category: Click on the desired category button
- Search: Search for the pattern you want in the search bar
- Copy: Click the 📋 button to copy the pattern
- Test: Click the 🧪 button to test directly in Regex Tester
Usage Examples
Form Validation
const emailRegex = /^[\w\.-]+@[\w\.-]+\.\w+$/;
if (!emailRegex.test(userInput)) {
alert('Invalid email address');
}
Data Extraction
const urlRegex = /https?:\/\/[^\s]+/g;
const urls = text.match(urlRegex);
Data Sanitization
const phoneRegex = /^01[0-9]-?[0-9]{3,4}-?[0-9]{4}$/;
const cleanPhone = phone.replace(/-/g, '');
Regex Tips
Common Metacharacters
^- Start of string$- End of string.- Any single character*- 0 or more repetitions+- 1 or more repetitions?- 0 or 1 occurrence[]- Character class|- OR operator()- Grouping
Flags
g- Global searchi- Case insensitivem- Multiline mode
Cautions
- Regex is not perfect - complex validation may require additional logic
- Be cautious with large texts as it can affect performance
- Don't rely solely on client-side validation; server-side validation is also necessary
Related Tools
- Regex Tester - Test and debug regular expressions
- String Escape - Escape special characters
- Text Diff - Compare text
Contributing
If you have more useful regex patterns, please suggest them!