日期:2014-05-16 浏览次数:20389 次
var s = '([1]@)&([2]@!)';
var r = /(\(.+?\))([^(]+?)(\(.+?\))/;
alert( s.match(r)[1] )
alert( s.match(r)[2] )
alert( s.match(r)[3] )
<script type="text/javascript">
var str ="([1]@) & ([2]@!)";
var arr =str.match(/(\([^\)]+\))([^\(]+)(\([^\)]+\))/);
console.log(arr)
</script>