var str="aab abb aba"
var re1=/\b(a)(\w)\1\b/g
var re2=/\b(?:a)(\w)\1\b/g
console.log( str.match(re1) )
console.log( str.match(re2) )
Ответ:
[ 'aba' ]
[ 'abb' ]
JavaScript test | #JavaScript
JA JavaScript test @js_test · 9.67K subscribers var str="aab abb aba"
var re1=/\b(a)(\w)\1\b/g
var re2=/\b(?:a)(\w)\1\b/g
console.log( str.match(re1) )
console.log( str.match(re2) )