常用正则表达式大全!(例如匹配中文、匹配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)).doc

常用正则表达式大全!(例如匹配中文、匹配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

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档