Quantcast
Channel: VMware Communities : Discussion List - Site Recovery Manager
Viewing all articles
Browse latest Browse all 3691

Find VM by Name RegEx - How to ignore case

$
0
0

Hi,

 

In vCO there is a standard Action that looks like this:

 

----------

// Get all Virtual Machines for all vCenter connections defined for this plugin

var allVms = VcPlugin.getAllVirtualMachines();

var vms = new Array();

// Check if the VM match the regexp

for (var i in allVms) {

  if (allVms[i].name.match(regexp)) {

  vms.push(allVms[i]);

  }

}

VMList = vms;

----------

 

How can I make this actions ignore the case. I searched for this in Java script, and found that I should add "/i" to the regexp, but I cannot get it to work.

  if (allVms[i].name.match(regexp/i)) {

 

Does anyone know how to get this working?

 

/Brian


Viewing all articles
Browse latest Browse all 3691

Trending Articles