let base = /a/g; let copy = new RegExp(base, 'i'); console.log(copy.flags);