「JavaScript」replace関数の使い方

JavaScriptコード
var str = “abcdefgname=’test’sddfhskshjsfsjdfps";
var reg = /name='((\w|-|\s)+)/ig;
str.replace(reg, function() {
console.log(arguments.length); //5
console.log(arguments[1]);//test
});

JavaScript

Posted by arkgame