![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Regular Expression
GavinMoreYoung
Dream again small also not too small,can't not have too big again
展开
-
02100211Regular Expressions Travel
Code Resource:https://github.com/MoreYoungGavin/02100211_Study_RegularExpression Expression Parts ( starts a group of atoms ) ends a group of atoms (?= starts a group that’s a posi...原创 2019-02-10 17:20:59 · 142 阅读 · 0 评论 -
C1:Words and Text
Finding Blank Lines ^\s*$ Finding Words \bword\b Finding Multiple Words with One Search \s+(word1|word2)\s+ Finding Variations on Words(john Doe,jon Doe,jonathan Doe) \bJoh?n(athan)? D...原创 2019-02-10 17:22:53 · 176 阅读 · 0 评论 -
C2:URLs and Paths
Extracting Domain Labels from URLs ^.*:\/\/(([a-z\d][-a-z\d]*[a-z\d]\.)*[a-z][-a-z\d]*[a-z]).*$ Example: Extracting the Port from a URL ^.*:(\d{1,}).*$ Example: Extracting the Path fro...原创 2019-02-10 17:24:00 · 197 阅读 · 0 评论 -
C3:CSV and Tab-Delimited Files
Finding Valid CSV Records ([^,\"]+|\"([^\"]|\"\")*\") Example: Finding Valid Tab-Delimited Records [^\t""]+ Example: Changing CSV Files to Tab-Delimited Files ,(?=(?:[^""]*$)|(?:[^"&qu原创 2019-02-10 23:52:51 · 713 阅读 · 0 评论 -
C4:Formatting and Validating
Formatting U.S Phone Numbers ^\(?(\d{3})\)?[- .]?(\d{3})[- .]?(\d{4})$ ($1) $2-$3 Example: Formatting U.S Dates ^(\d{1,2})[-\/.]?(\d{1,2})[-\/.]?((?:\d{2}|\d{4}))$ $1-$2-$3 Example: ...原创 2019-02-10 23:55:19 · 187 阅读 · 0 评论 -
C5:HTML and XML
Finding an XML Tag <[a-z:_][-a-z0-9._:]+((\s+[^>]+)*|/s*)/?> Example: Finding an HTML Attribute (?:<[^>\s]+)(\s+[a-z]+(-[a-z]+)?(=(""[^<&""]*""|'[^<&']*原创 2019-02-10 23:56:59 · 137 阅读 · 0 评论 -
C6:Source Code
Finding Code Comments ^(?:[^""]*?(?:""[^""]*?""[^""]*?)?)*(?:/\*|//) Example: Finding Lines with an Odd Number of Quotes ^[^"]*"([^"]*|([^"]*"[^"]*"[^"]*)*原创 2019-02-10 23:59:00 · 221 阅读 · 0 评论