javascript regex.exec with all 'string'

by robert chang

JavaScript

var s = 'plain string plus some other symbol + other string '
var re = 'plain string plus some other symbol + '
var reg = new RegExp(re,'gu')
var myArray;
myArray = reg.exec(s)
console.log(myArray)

var s = 'plain string plus some other symbol and other string '
var re = 'plain string plus some other symbol and '
var reg = new RegExp(re,'gu')
var myArray;
myArray = reg.exec(s)
console.log(myArray)