Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

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 6251

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>