常用正则表达式大全!(例如匹配中文、匹配html)(Commonly used regular expressions Daquan (for example match Chinese, match HTML)).docVIP
- 8
- 0
- 约4.9千字
- 约 6页
- 2017-10-16 发布于河南
- 举报
常用正则表达式大全!(例如匹配中文、匹配html)(Commonly used regular expressions Daquan (for example match Chinese, match HTML))
常用正则表达式大全!(例如匹配中文、匹配html)(Commonly used regular expressions Daquan (for example match Chinese, match HTML))
Encyclopedia of regular expressions! (for example, match Chinese and match HTML)
Regular expressions that match Chinese characters: [u4e00-u9fa5]
Commentary: match Chinese is really a headache, with this expression will be easy to handle
Matches double byte characters (including Chinese characters),:[^x00-xff]
Commentary: can be used to calculate the length of a string (a double byte character length 2, ASCII character 1)
Regular expression that matches blank rows: ns*r
Comment: can be used to delete blank lines
Regular expression matching HTML markers: (S*?) [^]*.*? |.* ?
Commentary: the online version is so bad that it can only match the parts, and still cant do anything about the complex nested markup
Regular expressions that match the first and last blank characters: ^s*|s*$
Commentary: can be used to remove the trailing blank characters (including spaces, tabs, formfeed etc.), expression is very useful
A regular expression that matches the Email address: w+ ([-+.]w+), *@w+ ([-.]w+), *.w+ ([-.]w+) *
Commentary: form validation is very practical
The regular expression that matches the URL URL: [a-zA-z]+: //[^s]*
Commentary: the online version of the function is very limited, the above basically meet the needs
Is it legal to match the account number? (the initial letter allows 5-16 bytes and allows alphanumeric underscore):^[a-zA-Z][a-zA-Z0-9_]{4,15}$
Commentary: form validation is very practical
Matches the domestic telephone number: d{3}-d{8}|d{4}-d{7}
Commentary: matching forms such as 0511-4405222 or 021Tencent QQ number: [1-9][0-9]{4,},
Commentary: Tencent QQ numbers start from 10000
Match the postcode of China: [1-9]d{5} (... D)
Commentary: the postcode of China is 6 digits
Match ID: d{15}|d{18}
Commentary: China has 15 or 18 identity cards
Match IP address: d+.d+.d+.d+
Commentary: useful when extracting IP addresses
Matching specific number
您可能关注的文档
- 实训学习文档(c# net)(Training study document (c# net)).doc
- 实验二-2(Experiment two, -2).doc
- 实验七 杨氏弹性模量的测定(Experiment seven determination of Young's modulus).doc
- 实验3(Experiment 3).doc
- 实行单一税收管辖权的理论依据(The theoretical basis for the implementation of a single tax jurisdiction).doc
- 实验室设计与规范(Laboratory design and specification).doc
- 实验5 树的宽度 层次遍历(Experiment 5 tree width hierarchy traversal).doc
- 实验设计的基本原则(Basic principles of experimental design).doc
- 宠物的属性互克表+绿宝石金手指代码(Pet attributes mutual Table + emerald gold finger code).doc
- 审时度势 锐意改革 平衡压力 和谐发展(Size up the situation, reform firmly, balance pressure and develop harmoniously).doc
原创力文档

文档评论(0)