정규 표현식 대전
저장| Detection type | regular expression (math.) | Example of detection |
|---|---|---|
| train number | /^[GCDZTSPKXLY1-9]\d{1,4}$/ | G1868、D102、D9、Z5、Z24、Z17 |
| Cell Phone Body Code (IMEI) | /^\d{15,17}$/ | 123456789012345、1234567890123456 |
| URL (or ip) with port number is required | /^((ht|f)tps?:\/\/)?[\w-]+(\.[\w-]+)+:\d{1,5}\/?$/ | 127.0.0.1:5050、baidu.com:8001、https://www.udtool.com:80、http://192.168.1.1:9090 |
| Web address (URL) | /^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?/ | https://xxx.org/v2/api/#v、www.udtool.com、www.qq.99、//www.udtool.com、ftp://baidu.qq、http://baidu.com、https://www.amap.com/search?id=BV1006、360.com:8080/vue/#/a=1 |
| Unified Social Credit Code (USCC) | /^[0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}$/ | 91230184MA1BUFLT44、92371000MA3MXH0E3W |
| Unified Social Credit Code (loose match) (15 digits/18 digits/20 digits/letters) | /^(([0-9A-Za-z]{15})|([0-9A-Za-z]{18})|([0-9A-Za-z]{20}))$/ | 91110108772551611J、911101085923662400 |
| thunderbolt link | /^thunderx?:\/\/[a-zA-Z\d]+=$/ | thunder://QUEsICdtYWduZXQ6P3h0PXVybjpidGloOjBCQTE0= |
| ed2k link (loose match) | /^ed2k:\/\/\|file\|.+\|\/$/ | ed2k://|file|%E5%AF%84%E7AB.PARASITE.2019.HD-1080p.X264.AAC-UUMp4(E00.COM).mp4|2501554832|C0BCBED732C20CE577A3|h=5HTKZPQF|/ |
| Magnetic link (loose match) | /^magnet:\?xt=urn:btih:[0-9a-fA-F]{40,}.*$/ | magnet:?xt=urn:btih:40A89A6F4FB1498A98087109D012A9A851FBE0FC |
| Subnet mask (without 0.0.0.0) | /^(254|252|248|240|224|192|128)\.0\.0\.0|255\.(254|252|248|240|224|192|128|0)\.0\.0|255\.255\.(254|252|248|240|224|192|128|0)\.0|255\.255\.255\.(255|254|252|248|240|224|192|128|0)$/ | 255.255.255.0、255.255.255.255、255.240.0.0 |
| linux "hidden file" paths | /^\/(?:[^/]+\/)*\.[^/]*/ | /usr/ad/.dd、/root/.gitignore、/.gitignore |
| linux folder path | /^\/(?:[^/]+\/)*$/ | /usr/ad/dd/、/、/root/、/aa/a/aa/ |
| linux file path | /^\/(?:[^/]+\/)*[^/]+$/ | /root/b.ts、/root/abc |
| Window "Folder" Path | /^[a-zA-Z]:\\(?:\w+\\?)*$/ | C:\Users\Adminr\Desktop、e:\m\ |
| Path to "file" under window | /^[a-zA-Z]:\\(?:\w+\\)*\w+\.\w+$/ | C:\Users\Admin\Desktop\qq.link、e:\m\vscode.exe |
| Stock code (A shares) | /^(s[hz]|S[HZ])(000[\d]{3}|002[\d]{3}|300[\d]{3}|600[\d]{3}|60[\d]{4})$/ | sz000858、SZ002136、sz300675、SH600600、sh601155 |
| Greater than or equal to 0, less than or equal to 150, support decimal places appearing 5, such as 145.5, used to determine the score of the examination paper | /^150$|^(?:\d|[1-9]\d|1[0-4]\d)(?:\.5)?$/ | 150、100.5 |
| html comments | /<!--[\s\S]*?-->/g | <!--<div class="_bubble"></div>--><div>chenguzhen87</div><div class="_bubble"></div>--> |
| md5 format (32-bit) | /^[a-fA-F0-9]{32}$/ | 21fe181c5bfc16306a6828c1f7b762e8 |
| GUID/UUID | /^[a-f\d]{4}(?:[a-f\d]{4}-){4}[a-f\d]{12}$/i | e155518c-ca1b-443c-9be9-fe90fdab7345、41E3DAF5-6E37-4BCC-9F8E-0D9521E2AA8D |
| The version number must be in X.Y.Z format. | /^\d+(?:\.\d+){2}$/ | 16.3.10 |
| Video link address (video format can be added or deleted as needed) | /^https?:\/\/(.+\/)+.+(\.(swf|avi|flv|mpg|rm|mov|wav|asf|3gp|mkv|rmvb|mp4))$/i | http://www.udtool.com/video/wc.avi |
| Image link address (image format can be added or deleted as needed) | /^https?:\/\/(.+\/)+.+(\.(gif|png|jpg|jpeg|webp|svg|psd|bmp|tif))$/i | http://www.udtool.com/logo.png |
| 24-hour time (HH:mm:ss) | /^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d$/ | 23:34:55 |
| 12-hour time (hh:mm:ss) | /^(?:1[0-2]|0?[1-9]):[0-5]\d:[0-5]\d$/ | 11:34:55 |
| base64 format | /^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([a-z0-9!$&',()*+;=\-._~:@/?%\s]*?)\s*$/i | data:image/gif;base64,xxxx== |
| Numeric/currency amounts (support for negative numbers, thousands separators) | /^-?\d{1,3}(,\d{3})*(\.\d{1,2})?$/ | 100、-0.99、3、234.32、-1、900、235.09、12,345,678.90 |
| ATM card number | /^[1-9]\d{9,29}$/ | 6234567890、6222026006705354000 |
| Chinese Name | /^(?:[\u4e00-\u9fa5·]{2,16})$/ | Ge, Kevin Durant, and Dirk Werner-Nowitzki. |
| Name in English | /(^[a-zA-Z][a-zA-Z\s]{0,20}[a-zA-Z]$)/ | James、Kevin Wayne Durant、Dirk Nowitzki |
| License plate number (new energy) | /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z](?:((\d{5}[A-HJK])|([A-HJK][A-HJ-NP-Z0-9][0-9]{4}))|[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳])$/ | Beijing AD92035, Gan G23459F, Beijing AA92035 |
| License plate number (non-new energy) | /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]$/ | Beijing A00599, Black D23908 |
| License plate number (new energy + non-new energy) | /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9挂学警港澳]$/ | 京A12345D、京A00599、京AD92035、甘G23459F、京AA92035 |
| 手机号(mobile phone)中国(严谨), 根据工信部2019最新公布的手机号段 | /^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[1589]))\d{8}$/ | 008618311006933、+8617888829981、19119255642、19519255642 |
| 手机号(mobile phone)中国(宽松), 只要是13,14,15,16,17,18,19开头即可 | /^(?:(?:\+|00)86)?1[3-9]\d{9}$/ | 008618311006933、+8617888829981、19119255642 |
| 手机号(mobile phone)中国(最宽松), 只要是1开头即可, 如果你的手机号是用来接收短信, 优先建议选择这一条 | /^(?:(?:\+|00)86)?1\d{10}$/ | 008618311006933、+8617888829981、19119255642 |
| Date (loose) | /^\d{1,4}(-)(1[0-2]|0?[1-9])\1(0?[1-9]|[1-2]\d|30|31)$/ | 1990-12-12、1-1-1、0000-1-1 |
| Date (rigorous, supports leap year judgment) | /^(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29)$/ | 1990-12-12、2000-02-29 |
| Chinese province | /^浙江|上海|北京|天津|重庆|黑龙江|吉林|辽宁|内蒙古|河北|新疆|甘肃|青海|陕西|宁夏|河南|山东|山西|安徽|湖北|湖南|江苏|四川|贵州|云南|广西|西藏|江西|广东|福建|台湾|海南|香港|澳门$/ | Zhejiang, Taiwan |
| The time that can be successfully transformed by momentum YYYYMMDD HH:mm:ss | /^\d{4}([/:-\S])(1[0-2]|0?[1-9])\1(0?[1-9]|[1-2]\d|30|31) (?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d$/ | 2020/01/01 23:59:59、2020-01-01 00:00:00、20200101 11:11:11 |
| /^(([^<>()[\]\\.,;:\s@"]+(\.[^<> ()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ | 90203918@qq.com, nbilly@126.com, 汉字@qq.com | |
| Tel phone (domestic), e.g. 0341-86091234 | /^(?:(?:\d{3}-)?\d{8}|^(?:\d{4}-)?\d{7,8})(?:-\d+)?$/ | 0936-4211235、89076543、010-12345678-1234 |
| Identity card number (1 generation, 15 digits) | /^[1-9]\d{7}(?:0\d|10|11|12)(?:0[1-9]|[1-2][\d]|30|31)\d{3}$/ | 123456991010193 |
| Identity card number (2 generations, 18 digits), the last digit is a check digit, may be a number or character X | /^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\d|30|31)\d{3}[\dXx]$/ | 12345619991205131x |
| ID number, support 1/2 generation (15/18 digits) | /^\d{6}((((((19|20)\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|(((19|20)\d{2})(0[13578]|1[02])31)|((19|20)\d{2})02(0[1-9]|1\d|2[0-8])|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))0229))\d{3})|((((\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|((\d{2})(0[13578]|1[02])31)|((\d{2})02(0[1-9]|1\d|2[0-8]))|(([13579][26]|[2468][048]|0[048])0229))\d{2}))(\d|X|x)$/ | 622223199912051311、12345619991205131x、123456991010193 |
| Passport (including Hong Kong and Macau) | /(^[EeKkGgDdSsPpHh]\d{8}$)|(^(([Ee][a-fA-F])|([DdSsPp][Ee])|([Kk][Jj])|([Mm][Aa])|(1[45]))\d{7}$)/ | s28233515、141234567、159203084、MA1234567、K25345719 |
| Whether the account number is legal (starts with a letter, allows 5-16 bytes, allows alphanumeric underscore combinations) | /^[a-zA-Z]\w{4,15}$/ | justin、justin1989、justin_666 |
| Chinese/Handwriting | /^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])+$/ | Regular, front-end |
| Decimals (scientific notation support) | /^[+-]?(\d+([.]\d*)?([eE][+-]?\d+)?|[.]\d+([eE][+-]?\d+)?)$/ | 0.0、0.09、4E+4 |
| Numbers only | /^\d+$/ | 12345678 |
| html tags (loose match) | /<(\w+)[^>]*>(.*?<\ /\1>)?/ | <div id="app"> 2333 </div>、<input type="text">、<br> |
| Match Chinese characters and Chinese punctuation | /[\u4e00-\u9fa5|\u3002|\uff1f|\uff01|\uff0c|\u3001|\uff1b|\uff1a|\u201c|\u201d|\u2018|\u2019|\uff08|\uff09|\u300a|\u300b|\u3008|\u3009|\u3010|\u3011|\u300e|\u300f|\u300c|\u300d|\ufe43|\ufe44|\u3014|\u3015|\u2026|\u2014|\uff5e|\ufe4f|\uffe5]/ | 匹配中文汉字以及中文标点符号(? ! , 、 ; : “ ” ‘ ' ( ) 《 》 〈 〉 【 】 『 』 「 」 ﹃ ﹄ 〔 〕 … — ~ ﹏ ¥) |
| qq number correctly formatted | /^[1-9][0-9]{4,10}$/ | 903013545、9020304 |
| numerical and alphabetic composition | /^[A-Za-z0-9]+$/ | james666、haha233hi |
| English alphabet | /^[a-zA-Z]+$/ | Russel |
| lowercase letters | /^[a-z]+$/ | russel |
| capital letters | /^[A-Z]+$/ | ABC、KD |
| Password strength checksum, minimum 6 digits, including at least 1 uppercase letter, 1 lowercase letter, 1 number, 1 special character | /^\S*(?=\S{6,})(?=\S*\d)(?=\S*[A-Z])(?=\S*[a-z])(?=\S*[!@#$%^&*? ])\S*$/ | Kd@curry666 |
| User name checksum, 4 to 16 bits (alpha, numeric, underscore, minus sign) | /^[\w-]{4,16}$/ | xiaohua_qq |
| ip-v4[:port] | /^((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])(?::(?:[0-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?$/ | 172.16.0.0、172.16.0.0:8080、127.0.0.0、127.0.0.0:998 |
| ip-v6[:port] | /(^(?:(?:(?:[0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$)|(^\[(?:(?:(?:[0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))\](?::(?:[0-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?$)/i | 2031:0000:130f:0000:0000:09c0:876a:130b |
| hexadecimal color | /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3}|[a-fA-F0-9]{8}|[a-fA-F0-9]{4})$/ | #f00、#fe9de8、#f8f8f8ff、#f003 |
| Microsignal (wx), 6 to 20 digits, starts with a letter, letter, number, minus sign, underscore | /^[a-zA-Z][-_a-zA-Z0-9]{5,19}$/ | github666、kd_-666 |
| Postal code (China) | /^(0[1-7]|1[0-356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[0-5]|8[013-6])\d{4}$/ | 734500、100101 |
| Chinese and numbers | /^((?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])|(\d))+$/ | Ha-ha-ha. You're a sixer. |
| Cannot contain letters | /^[^A-Za-z]*$/ | Hello 6, @¥()! |
| java package name | /^([a-zA-Z_]\w*)+([.][a-zA-Z_]\w*)+$/ | com.bbb.name |
| mac address | /^(([a-f0-9][0,2,4,6,8,a,c,e]:([a-f0-9]{2}:){4})|([a-f0-9][0,2,4,6,8,a,c,e]-([a-f0-9]{2}-){4}))[a-f0-9]{2}$/i | 38:f9:d3:4b:f5:51、00-0C-29-CA-E4-66 |
| Match consecutively repeated characters | /(.)\1+/ | Me Me Me Me, 112233, 11234 |
| Numeric and alphabetic composition and containing both numeric and alphabetic characters | /^(?=.*[a-zA-Z])(?=.*\d).+$/ | I a I 1 I, a to 1 |
| Hong Kong Identity Card | /^[a-zA-Z]\d{6}\([\dA]\)$/ | K034169(1) |
| Macau Identity Card | /^[1|5|7]\d{6}\(\d\)$/ | 5686611(1) |
| Taiwan Identity Card | /^[a-zA-Z][0-9]{9}$/ | U193683453 |
| 大写字母,小写字母,数字,特殊符号 `@#$%^&*`~()-+=` 中任意3项密码 | /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_!@#$%^&*`~()-+=]+$)(?![a-z0-9]+$)(?![a-z\W_!@#$%^&*`~()-+=]+$)(?![0-9\W_!@#$%^&*`~()-+=]+$)[a-zA-Z0-9\W_!@#$%^&*`~()-+=]/ | a1@、A1@、Aa@ |
| All special characters in the ASCII code list. | /[\x21-\x2F\x3A-\x40\x5B-\x60\x7B-\x7E]+/ | [、.、^、&3% |
| Positive integers, not including 0 | /^\+?[1-9]\d*$/ | 1231 |
| Negative integer without 0 | /^-[1-9]\d*$/ | -1231 |
| integer (math.) | /^(?:0|(?:-?[1-9]\d*))$/ | -1231、123、0 |
| floating point | /^(-?[1-9]\d*\.\d+|-?0\.\d*[1-9]\d*|0\.0+)$/ | 1.23、-1.01、0.00 |
| floating point (strict) | /^(-?[1-9]\d*\.\d+|-?0\.\d*[1-9])$/ | 1.23、-1.01 |
| email(support Chinese email) | /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/ | 90203918@qq.com, nbilly@126.com, 啦啦啦@126.com |
| Domain name (not web address, does not contain an agreement) | /^([0-9a-zA-Z-]{1,}\.)+([a-zA-Z]{2,})$/ | www.baidu.com、baidu.com.cn、api.baidu.com、udtool.com |
| Officers/enlisted personnel cards | /^[\u4E00-\u9FA5](字第)([0-9a-zA-Z]{4,8})(号?)$/ | Military No. 1234567, Sergeant No. P123456X |
| household register | /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/ | 441421999707223115 |
1. 정규 표현식(Regular Expression, 약칭 Regex 또는 RE)은 문자열 내의 문자 조합을 일치시키는 데 사용되는 패턴입니다.
2. 정규 표현식은 이론 및 컴퓨터 과학 분야에서 비롯되었으며, 현재는 다양한 프로그래밍 언어와 텍스트 처리 도구에서 텍스트 검색, 교체, 검증 및 구문 분석에 널리 사용되고 있습니다.
3. 정규 표현식의 기본 구성 요소는 다음과 같습니다:
(1) 문자 일치: 알파벳, 숫자 또는 기호와 같은 구체적인 문자를 일치시킵니다. 예: a는 문자 ‘a’와 일치합니다.
(2) 메타 문자: 특별한 의미를 지닌 문자로, 특정 패턴을 나타내는 데 사용됩니다. 예: .은 줄바꿈 문자를 제외한 임의의 단일 문자와 일치합니다; *는 앞의 문자가 0회 이상 반복될 수 있음을 나타냅니다.
(3) 문자 집합: 대괄호 []로 표시되며, 그 안의 임의의 문자와 일치합니다. 예: [abc]는 ‘a’, ‘b’ 또는 ‘c’와 일치합니다.
(4) 반복 횟수: 앞의 요소가 반복될 수 있는 횟수를 지정합니다. 예: a{3}은 ‘aaa’와 일치하고, a{2,4}는 ‘aa’, ‘aaa’ 또는 ‘aaaa’와 일치합니다.
(5)、분기: 수직선 |으로 표시하며, “또는” 관계를 나타냅니다. 예: a|b는 ‘a’ 또는 ‘b’와 일치합니다.
(6)、그룹화: 둥근 괄호 ()로 표시하며, 여러 요소를 하나의 단위로 묶을 수 있습니다. 예: (ab)는 ‘ab’를 하나의 전체로 간주합니다.
(7)、앵커: 일치할 위치를 지정하는 데 사용됩니다. 예: ^는 문자열의 시작을, $는 문자열의 끝을 나타냅니다.
4、본 페이지 데이터 출처: https://github.com/trentlee0/utools-any-rule/blob/master/src/RULES.js
추천
Base64/파일 교환
온라인 Base64 및 파일 교환 위젯
(BFR) 체지방률 계산
체지방률(BFR) 온라인 계산기
제곱근 계산 도구
온라인 제곱근 컴퓨팅 도구
친척 호칭 계산기
중국 가족 친척 온라인 계산기
CMYK/16진수 색상 변환
CMYK 형식과 HEX 형식 간의 색상 변환 도구.
색상 일치 계산기
색상 간의 일치 정도를 정확하게 계산하여 사용자가 미적 매칭 솔루션을 쉽게 얻을 수 있도록 도와줍니다.
CSS 버튼 온라인 생성 도구
온라인 시각화 디버그 버튼 및 CSS 코드 생성
방귀 소리 시뮬레이션
온라인 방귀 소리 시뮬레이션 도구
파일 MD5 계산
온라인 파일 MD5 계산 도구
역사상의 오늘
조회 역사상 매일 발생하는 중요한 사건
그림에 워터마크
클릭 한 번으로 그림에 워터마크 추가
야자수 스타일 사진 생성기
야자수 야자수 스타일 사진 생성기
명절 대전
온라인으로 매년 모든 축제 조회
틱택 토 게임
컴퓨터와 대결하는 틱택토 미니 게임
JSON/GET 요청 문자열 상호 변환
온라인 JSON 및 GET 요청 문자열 상호 변환 도구
격려문
격려 문장, 긍정 에너지 문장
남학생 여청궁도
청궁이 간직한 남학생 여자 예측표
PDF 파일 페이지 번호 추가
온라인으로 PDF 파일에 페이지 번호 추가
테트리스
온라인 테트리스 미니 게임
무작위 생성기
다른 랜덤 생성
절반 / 전체 변환
모서리 기호와 모서리 기호 상호 변환 도구
세계 각국 수도 조회 도구
온라인 세계 각국 수도 온라인 조회 도구
텍스트 줄 번호 추가 도구
온라인으로 텍스트에 줄 번호 추가 도구
브라 사이즈 대조표
여성 브라 사이즈 온라인 대조표
























粤ICP备2021116614号