Find a VM by RegEx name - how to ignore case

Hello

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 ();

machines virtual var = new Array();

Make sure the virtual machine matches the regular expression

for (var i in allVms) {}

If (allVms [i].name.match (regexp)) {}

VMS.push (allVms [i]);

}

}

VMList = MV;

----------

How can I do this actions ignore the case. I searched this in Java script and found that I have to add "/ I" in the regular expression, but I can't make it work.

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

Anyone know how to get this working?

/ Brian

This should work with a variable:

var allDcs = VcPlugin.allDatacenters;
var nameToMatch = "B00019V";
for (var i in allDcs) {
  if (allDcs[i].name.match(new RegExp(nameToMatch, "i"))) {
    System.log("found match -> " + allDcs[i].name);
  }
}

Tags: VMware

Similar Questions

  • How to ignore case in the Apex?

    Hello

    I have provided a link to an article (Hostname) in one of the attributes of the column.
    When I click on the link, need me a page if there is an exact match in the "Hostname".
    However, a same host does not match if his name is different between uppercase and lowercase.
    Ex: EU1PAPW002 does not match eu1papw002

    Is it possible to ignore the case by matching?
    Need help on this.

    Concerning
    Sharath

    I'm glad it helped!

  • in error occurred trying to find your application OR software name and path

    Hi all

    I installed Labview2009 in my PC. Now when I try to find the example implementation begun to Labview screen.

    An error popup "error has occurred trying to find your NOR application software name and path. So NEITHER example finder is opening, but do not include examples.

    How can I solve this error?

    Thank you

    -Vishnu

    The first thing I would try is to go to 'Control Panel': ' Add or Remove Programs ", look for National Instruments software and try to do a 'repair' your LabVIEW installation. Otherwise it may require an uninstall, reinstall the entire package.

  • Why can't search contacts on my profile bar, the search I want to say that if I need to find contacts I put the name in the search bar on my profile but still they say that this contact does not exist

    Why can not search for contacts on my profile bar, the search I want to say that if I need to find contacts I put the name in the search bar on my profile but still they say that this contact does not exist why this before it was ok

    original title: the search for contacts

    Hi Sam,

    First select the operating system you are using, or maybe give an indication on the operating system installed on your computer. While other members of the community can help you with this problem.

    You use Outlook?

    Are you referring to outlook contacts?

    Reference: http://support.microsoft.com/kb/555375

  • Where should I go on my computer to find the pie chart that shows how much space is used/left on my computer?

    Where should I go on my computer to find the pie chart that shows how much space is used/left on my computer... (my question is not related to the questions at the beginning).

    Open my computer, right-click the drive icon, select 'Properties' and you'll see the pie under the general tab.

    Jim

    Microsoft MVP - moderator of the Forum - consumer security live a care - Live Mesh - Microsoft Security Essentials

  • Download error "Windows cannot find"C:\Users\User\Downloads\ ((name of the program here))". Make sure you typed the name correctly and try again. »

    Original title: ((Vista)) I can't install anything!

    So, basically, I have a Windows Vista. I'm using Google Chrome, but that doesn't really count because I tried on all browsers. When I try to download something, it comes up with something like that... "Windows cannot find"C:\Users\User\Downloads\ ((name of the program here))". Make sure you typed the name correctly and try again. "This has nothing to do with a name of typing correctly. I'm downloading at the wrong place? If Yes, where can I download it?

    Hello

    Thanks for posting in the Microsoft Community.

    If I understand correctly that you have problems with downloading files on Windows Vista.

     

    Please follow the below mentioned thread that addresses a similar issue:

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-files/Windows-cannot-find-error/537677b9-016b-427e-8cc6-50f8620c84bb

    Note: The thread also applies to Windows Vista.

    Hope the helps of information. We know if you need help. We will be happy to help you.

  • I enter the wrong server name, how can I change it?

    I downloaded the program to send videos by e-mail, I entered the wrong server name how can I change it?

    I downloaded the program to send videos by e-mail, I entered the wrong server name how can I change it?

    ====================================
    I assume you mean Windows Live Mail?

    Try to open Windows Live Mail and go...
    Tools / accounts / select (highlight) the account in question / properties button / tab server...

  • When I send an email or an attachment it happen as the benefits of discovery as the sender and not my name, how can I change this?

    When I send an email or an attachment it happen as the benefits of discovery as the sender and not my name, how can I change this? his strange huh?

    I never stay connected to my email, I actually get hacked somehow I have change my password often enough

    Hi darenlysne,

    It sounds like you have the email account of incorrect installation and hurt the server info.

    Provide the program that you are using and we can go from there, or contact your ISP.

    B Eddie

  • I can't find where to change the name of the company.

    I already have an account, but I would change my company name in my account. I can't find where to change the name of the company.

    Hello

    Please visit https://helpx.adobe.com/x-productkb/global/adobe-change-of-name-form-and-procedure.html

    Or you can contact our support here: https://helpx.adobe.com/contact.html

    Let us know if this helps!

  • ﷯Error - error message: an element on the page "News" at location 33 642 requires the pixelation, but is too large to rasterize. Resize it smaller and try again... I can't fix this or find that the line number.  How can I find this line?

    ﷯Error - error message: an element on the page "News" at location 33 642 requires the pixelation, but is too large to rasterize. Resize it smaller and try again... I can't fix this or find that the line number.  How can I find this line?

    I don't know why it worked, but I changed the police and was able to download Web site.  Thanks for your help!

  • I just got a new computer and I can't find my lightroom license key. How can I get a new one?

    I just got a new computer and I can't find my lightroom license key. How can I get a new one?

    Thank you!

  • I downloaded cs6 and can't find it on my computer. How can I find?

    I downloaded cs6 and can't find it on my computer. How can I find?

    Hi Dori,

    I would suggest to look into your downloads folder and then install the files.

    Have you downloaded the location of the list software? If this isn't the case, you may need to download it again. Products download CS6

    Thank you

    Scott

  • Cannot find a process with the name 'perl '.

    Hey all,.

    Tryign to configure the script in my dev environment and I receive the email ok, but does not get the report attached to the email... Here are the keys error I get with executing the script on the computer Windows 7 using PowerCLI 5.0... Thoughts?

    ___________________________________________________________________________

    Get-Process: cannot find a process with the name 'perl '. Process audit na
    me and call the cmdlet again.
    C:\scripts\report.ps1:3 char: 18
    + $pp = get-process < < < < perl
    + CategoryInfo: ObjectNotFound: (perl:String) [Get-Process], Pro
    cessCommandException
    + FullyQualifiedErrorId: NoProcessFoundForGivenName, Microsoft.PowerShell.
    Commands.GetProcessCommand

    You can not call a method on a null value expression.
    C:\scripts\report.ps1:4 tank: 16
    + $pp.waitforexit < < < <)
    + CategoryInfo: InvalidOperation: (waitforexit:String)], Runti
    meException
    + FullyQualifiedErrorId: InvokeMethodOnNull

    New-Object: Exception calling ".ctor' with '1' or the arguments:"Could not find fi.
    the "C:\scripts\vmware_health_check20110912.html". »
    C:\scripts\report.ps1:8 char: 18
    + $att = new-object < < < < Net.Mail.Attachment ($file)
    + CategoryInfo: InvalidOperation: (:)) [New-Object], MethodInvoca)
    tionException
    + FullyQualifiedErrorId: ConstructorInvokedThrowException, Microsoft.Power
    Shell.Commands.NewObjectCommand

    Exception by calling 'Add' with '1' arguments: "value cannot be null."
    ' Parameter name: agenda.
    C:\scripts\report.ps1:14 char: 21
    + $msg. Attachments.Add < < < < ($att)
    + CategoryInfo: NotSpecified: (:)) [], MethodInvocationException)
    + FullyQualifiedErrorId: DotNetMethodException

    You can not call a method on a null value expression.
    C:\scripts\report.ps1:16 char: 13
    + $att. Have < < < <)
    + CategoryInfo: InvalidOperation: (available: String) [], RuntimeEx
    reception
    + FullyQualifiedErrorId: InvokeMethodOnNull

    Remove-Item: can not find the path "C:\scripts\vmware_health_check20110912.html" be
    cause, that there is not.
    C:\scripts\report.ps1:17 tank: 12
    + Remove-Item < < < < C:\scripts\vmware_health_check$dt.html
    + CategoryInfo: ObjectNotFound: (C:\scripts\vmwa...ck20110912.ht
    ml:String) [Remove-Item], ItemNotFoundException
    + FullyQualifiedErrorId: PathNotFound, Microsoft.PowerShell.Commands.Remov
    eItemCommand

    The script uses the Perl API and not the PowerShell.  So the last SDK Perl install and be sure that your backup script as *.pl rather than *.ps1

    Concerning
    Joerg

  • Find/replace: how to force case sensitive?

    Hello

    I'm doing a find / change and cannot work out how to force the wildcard to be lowercase. I am trying to replace E e, but it's for me instead.

    Should I use the glyph of find / change, perhaps? I don't want to limit my search to a single font and style.

    I'm doing a series of find / change using the FindChangeByList.jsx script. I don't know if it will make a difference for all solutions.

    I'm using CS3 on Mac.

    Have you clicked on the "case sensitive" button in the dialog box?

  • I try and put music on my phone through the Apple music and it says something about waiting for 90 days. Anyone know what it is or how to ignore it?

    I try and put music on my phone through the Apple music and it says something about waiting for 90 days. Anyone know what it is or how to ignore it?

    Looks like you may have recently changes your Apple ID you use iTunes on your iPhone.  When you change this ID, you are locked for 90 days.  You can change to another code, but you can download past purchases or save the content on your device until the expiry of this original lock.  When you change IDs the first time it is a nice warning that appears and asks if you are sure that you'll be locked in this ID for 90 days.  There is no way around the lock, other only of waiting.  I think that this prevents you form jittering in all your Apple ID friends and just download all, but that's probably what you're going through right now.  Good luck!

Maybe you are looking for