正则表达

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

原文地址:https://www.cnblogs.com/xkxf/p/6850552.html