关于正则表达式

string=string.replace(/!!/g, '"');
是什么意思,
特别是g是什么意思
---------------------------------------------------------------

string=string.replace(/!!/g, '"');
替换字符串中的!!为"

g 全文查找出现的所有 pattern
---------------------------------------------------------------

global
全部匹配
如果没有这个参数只替换第一个

Published At
Categories with Web编程
comments powered by Disqus