JS代码如下:
/**
* 根据pattern进行正则匹配,匹配则返回结果,不匹配返回null
* @param
* @arrange (512.笔记) jb51.cc
**/
<script type="text/javascript">
var str = "ThIS isn't me";
var reg = /is/ig;
var ret = str.match(reg);
alert(ret); //IS,is
console.log(ret); //["IS","is"]
</script>
// 来自:编程之家 jb51.cc(jb51.cc)
原文链接:https://www.f2er.com/js/527605.html