JS代码如下:
/**
*
* @param
* @arrange (512.笔记) jb51.cc
**/
<script type="text/javascript">
var str = 'http://www.baidu.com/';
var reg = /\W/;
var ret = str.split(reg);
console.log(ret); //["http","","www","baidu","com",""]
</script>
// 来自:编程之家 jb51.cc(jb51.cc)
原文链接:https://www.f2er.com/js/527602.html