I want to do some sort of searching with this:
if (v.name.search(new RegExp(/peter/i)) != -1) {
console.log('found peter's record');
}
But how can I put a variable into that regular expression? I have tried with v.name.search(new RegExp('/'+var+'/i')), but it didn't work.
Thank you.
[a-z]orpeter?