Please see below example and correct me if I am doing it wrong,
let _regex = new RegExp("L", "gi");
var strings = ["List", "List Items", "List attachments"];
for (let i = 0; i < strings.length; i++) {
if (_regex.test(strings[i])) {
console.log(strings[i]);
}
}
Expected result is : all 3 results But logs only two List and List attachments