正则表达式是一个描述字符模式的对象。
10.1 正则表达式的定义
正则表达式对象更多的通过一种特殊的直接量语法进行定义。
var parttern =/s$/ ======= var parttern = new RegExp('s$')
10.3 正则表达式的方法
![](https://img.haomeiwen.com/i5726513/a2c43c14344cd1b1.png)
test
![](https://img.haomeiwen.com/i5726513/3527c38eeaff9d7f.png)
exec
![](https://img.haomeiwen.com/i5726513/41a987416caf67c2.png)
![](https://img.haomeiwen.com/i5726513/8a3508730acdbc1d.png)
![](https://img.haomeiwen.com/i5726513/ef75d96342c098b6.png)
![](https://img.haomeiwen.com/i5726513/ad74caccbcbff0f8.png)
![](https://img.haomeiwen.com/i5726513/c31fb02d2037b9df.png)
match/search
![](https://img.haomeiwen.com/i5726513/568ead88168b28a4.png)
![](https://img.haomeiwen.com/i5726513/2e6ea7a88cb30ff4.png)
replace
![](https://img.haomeiwen.com/i5726513/7aa99e30dad9c815.png)
![](https://img.haomeiwen.com/i5726513/c24891f6d649a71c.png)
正则表达式对象更多的通过一种特殊的直接量语法进行定义。
var parttern =/s$/ ======= var parttern = new RegExp('s$')
本文标题:第10章 正则表达式的模式匹配
本文链接:https://www.haomeiwen.com/subject/yvvsextx.html
网友评论