正则表达式工具
使用实时匹配测试和构建正则表达式
正则表达式工具
输入正则表达式和测试文本,实时查看匹配结果
未找到匹配项
电子邮件
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
Matches valid email addresses
URL
^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$
Matches URLs with or without http(s) prefix
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]?)$
Matches IPv4 addresses
日期 (YYYY-MM-DD)
^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$
Matches dates in YYYY-MM-DD format
时间 (HH:MM:SS)
^([01]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$
Matches times in HH:MM:SS or HH:MM format
电话号码
^\+?[1-9]\d{1,14}$
Matches international phone numbers (E.164 format)
强密码
^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$
Matches strong passwords (min 8 chars, at least one uppercase, lowercase, number, and special character)