【Python】正則表達式1(未完)
阿新 • • 發佈:2017-05-14
pes mmu get regular rop 則表達式 line out github
1、正則表達式唯一的用途就是在文本中匹配和尋找模式,模式可以簡單,也可以復雜。
2、Regexr 這個網站很個性的就是,有一個community標簽,打開後可以看到評分由高到低排列的 正則。
3、待匹配的文本 順便mark 作者的git
THE RIME OF THE ANCYENT MARINERE, IN SEVEN PARTS.
ARGUMENT.
How a Ship having passed the Line was driven by Storms to the cold
Country towards the South Pole; and how from thence she made her course
to the tropical Latitude of the Great Pacific Ocean; and of the strange
things that befell; and in what manner the Ancyent Marinere came back to
his own Country.
I.
1 It is an ancyent Marinere,
2 And he stoppeth one of three:
3 "By thy long grey beard and thy glittering eye
4 "Now wherefore stoppest me?
4、字符組取反:\D 等價 [^0-9] 等價 [^\d] 匹配所有非數字。
5、\w
【Python】正則表達式1(未完)