サブパターンを取得できないのはなぜですか? undefined出力が期待されるときにコンソールが表示されhelloます。に変更matches[1]するmatches[0]と、 が得られ{{hello}}ます。では、なぜサブパターンにアクセスできないのでしょうか?
var str = "{{hello}}";
var matches = str.match(/{{(.+)}}/ig);
console.log(matches[1]);
サブパターンを取得できないのはなぜですか? undefined出力が期待されるときにコンソールが表示されhelloます。に変更matches[1]するmatches[0]と、 が得られ{{hello}}ます。では、なぜサブパターンにアクセスできないのでしょうか?
var str = "{{hello}}";
var matches = str.match(/{{(.+)}}/ig);
console.log(matches[1]);