私は文字列を持っています
var stringP= "hi".rand(1,10)." my".rand(10,100)."name is ".rand(23,54).rand(1,4)
パターンは
rand(from,to)
取得する必要があります
hi5 my54name is 335
そのようなものを使用することは可能ですか?
stringP.replace(/rand(*,*)/g, function(match){
return match.replace(rand(*,*),Math.floor(Math.random() * (to - from + 1) + from));
});