正则
TODO:
JavaScript Regular Expressions for Regular People
https://alligator.io/js/regular-expressions-for-regular-people/
贪婪和replace
https://segmentfault.com/a/1190000012211651
基本形式:
/reg/
i 忽略大小写
g 全局
m 多行
方法
serach 返回起始index
replace 返回替换后的string
match
- g 多个返回值
- [值, index, input]
test 检索,true of false
exec - value/null
- g 多次调用,向后进行(懒惰)