B. 量词
![](https://images2017.cnblogs.com/blog/1065651/201712/1065651-20171224225457818-2013376597.png)
![](https://images2017.cnblogs.com/blog/1065651/201712/1065651-20171224225458006-2054835244.jpg)
一,“+”量词
![](https://images2017.cnblogs.com/blog/1065651/201712/1065651-20171224225458146-98338238.png)
![](https://images2017.cnblogs.com/blog/1065651/201712/1065651-20171224225458271-1587836565.png)
看一下没有"+"量词的匹配情况:
![](https://images2017.cnblogs.com/blog/1065651/201712/1065651-20171224225458646-68659217.png)
![](https://images2017.cnblogs.com/blog/1065651/201712/1065651-20171224225459100-122038127.png)
![](https://images2017.cnblogs.com/blog/1065651/201712/1065651-20171224225459381-386689522.png)
![](https://images2017.cnblogs.com/blog/1065651/201712/1065651-20171224225459521-473546618.jpg)
![](https://images2017.cnblogs.com/blog/1065651/201712/1065651-20171224225459803-1536551440.png)
![](https://images2017.cnblogs.com/blog/1065651/201712/1065651-20171224225459990-1349361484.png)
![](https://images2017.cnblogs.com/blog/1065651/201712/1065651-20171224225458146-98338238.png)
![](https://images2017.cnblogs.com/blog/1065651/201712/1065651-20171224225458271-1587836565.png)
看一下没有"+"量词的匹配情况:
![](https://images2017.cnblogs.com/blog/1065651/201712/1065651-20171224225458396-662869766.jpg)
此时,匹配失败,因为在字符串中没有"php"子串,但是有了量词“+”,就不一样了
![](https://images2017.cnblogs.com/blog/1065651/201712/1065651-20171224225458521-1042542855.png)
匹配成功,因为匹配模式中包含了+,就是前导字符h,可以出现1次或者多次
二,“*”量词
![](https://images2017.cnblogs.com/blog/1065651/201712/1065651-20171224225458646-68659217.png)
三,“?”量词
![](https://images2017.cnblogs.com/blog/1065651/201712/1065651-20171224225459100-122038127.png)
四,“.”量词
![](https://images2017.cnblogs.com/blog/1065651/201712/1065651-20171224225459240-160009115.png)
五,“{x}”量词 ,“{x,y}”量词,“{x,}”量词
![](https://images2017.cnblogs.com/blog/1065651/201712/1065651-20171224225459381-386689522.png)
六,“$”量词
![](https://images2017.cnblogs.com/blog/1065651/201712/1065651-20171224225459521-473546618.jpg)
七,“^”量词
![](https://images2017.cnblogs.com/blog/1065651/201712/1065651-20171224225459662-1332356466.png)
![](https://images2017.cnblogs.com/blog/1065651/201712/1065651-20171224225459803-1536551440.png)
八,“|”量词
![](https://images2017.cnblogs.com/blog/1065651/201712/1065651-20171224225459990-1349361484.png)
九,“()”
![](https://images2017.cnblogs.com/blog/1065651/201712/1065651-20171224225500115-1597208523.png)