CA Configuration Automation

 View Only
Expand all | Collapse all

Retrieving multiple matches in a regex for a BP parameter

  • 1.  Retrieving multiple matches in a regex for a BP parameter

    Posted Oct 25, 2019 09:00 AM
    Hi

    In a Blueprint, we are using regex to obtain a parameter value (directive type: configuration). But there are more than one occurrences when applying the pattern and only one is returned. We tried to include in the regular expression the Possix pattern flag /g (global) but it didn`t work. We checked in a Posix Pattern simulator and the expression is right. Does not CCA suppport POSIX pattern /g flag? How can we retrieve all the matches?



  • 2.  RE: Retrieving multiple matches in a regex for a BP parameter

    Posted Oct 30, 2019 09:11 AM

    This is the regex:


    remote:\/\/[a-zA-Z0-9]{4}rs(es1|es2|es3).dominio:3333

    We wanted to apply /g for multiple occurences (3):

    /remote:\/\/[a-zA-Z0-9]{4}rs(es1|es2|es3).dominio:3333/g

    This is the original value to apply the pattern:

    remote://env1rses1.dominio:1111,remote://env1rses1.dominio:2222,remote://env1rses1.dominio:3333,remote://env1rses1.dominio:4444,remote://env1rses1.dominio:5555,remote://env1rses2.dominio:1111,remote://env1rses2.dominio:2222,remote://env1rses2.dominio:3333,remote://env1rses2.dominio:4444,remote://env1rses2.dominio:5555,remote://env1rses1.dominio:6666,remote://env1rses3.dominio:1111,remote://env1rses3.dominio:2222,remote://env1rses3.dominio:3333,remote://env1rses3.dominio:4444,remote://env1rses3.dominio:5555,remote://env1rses3.dominio:6666