邮箱
联系方式 /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/giContact us at [email protected] or [email protected]
常用 JavaScript RegExp 模板:联系方式、网络、身份、Web、日期时间、安全与代码等。
All processing on this page runs locally in your browser unless noted otherwise.
共 34 条
/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/giContact us at [email protected] or [email protected]
/1[3-9]\d{9}/gCall 13812345678 or 15900001111 today.
/\+?[1-9]\d{7,14}/g+8613812345678 / +12025550123 / 442071838750
/^[a-zA-Z][a-zA-Z0-9_]{2,15}$/alice_01 _bad ab ValidUser
/https?:\/\/[^\s/$.?#].[^\s]*/giVisit https://example.com/path and http://localhost:3000/regex
/(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)/gServers: 192.168.1.1, 10.0.0.42, 8.8.8.8, 999.1.1.1
/(?:[A-Fa-f0-9]{1,4}:){7}[A-Fa-f0-9]{1,4}/giAddr: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
/(?:[0-9A-Fa-f]{2}[:-]){5}[0-9A-Fa-f]{2}/giNIC 00:1A:2B:3C:4D:5E or 00-1A-2B-3C-4D-5E
/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}/giHosts: example.com, sub.toolsworkbox.com, localhost
/[1-9]\d{5}(?:19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dXx]/gID sample: 11010519491231002X
/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}/giid=550e8400-e29b-41d4-a716-446655440000
/#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})\b/gcolors: #fff #1a2b3c #11223344 #gg0000
/^[a-z0-9]+(?:-[a-z0-9]+)*$/hello-world Hello hello--world post-2024
/[\u4e00-\u9fff]+/gHello 世界 and 正则工具箱
/-?\d+(?:\.\d+)?/gValues: 42, -3.14, 1000, .5
/-?\d+/gints 1 -2 003 4.5
/^\s+$/gmok end
/"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'/gsay "hello\"world" and 'it\'s fine'
/<\/?[a-zA-Z][^>]*>/g<div class="x">hi</div><br/>
/\[([^\]]+)\]\(([^)]+)\)/gSee [docs](https://example.com) and [home](/).
/\.[a-zA-Z_-][\w-]*/gdiv.btn .is-active #id .2bad
/[?&]([^=&#]+)=([^&#]*)/ghttps://x.com/?q=regex&lang=zh&empty=
/\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])/gdates 2024-01-15 2024-13-01 1999-12-31
/\d{4}年(?:0?[1-9]|1[0-2])月(?:0?[1-9]|[12]\d|3[01])日/g会议 2024年3月5日 / 2024年12月31日
/(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d)?/glog 09:30 23:59:01 24:00 7:5
/\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:?\d{2})?/g2024-01-15T10:22:01Z 2024-01-15 10:22:01+08:00
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^\w\s]).{8,}$/Abcd1234! weak NoSpecial1
/eyJ[A-Za-z0-9_-]+\.eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/gtoken=eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxIn0.abc
/(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?/gpayload SGVsbG8gV29ybGQ= end
/\b(?:\d[ -]*?){13,19}\b/gcard 4111 1111 1111 1111 / 5500-0000-0000-0004
/[$A-Za-z_][$\w]*/gconst fooBar = $el; 12bad
/\b\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?\b/gv1.2.3 2.0.0-beta.1 1.0.0+build.7
/\b[0-9a-f]{7,40}\b/gicommit a1b2c3d and full deadbeefdeadbeefdeadbeefdeadbeefdeadbeef
/^[A-Za-z0-9-]+:\s*.+$/gmFrom: [email protected] Subject: Hello body
适合作为起点。请务必用真实数据与业务规则再验证。
可在测试器的收藏夹保存,或通过「导入导出」Tab 用 JSON 管理。