Regular expressions (regex)

Comments

4 comments

  • Pablo Gonzalez
    Celigo University Level 4: Legendary
    Engaged

    Hi team, I'm trying to use an assertion as the example above, however I get the following error:

    'Could not compile handle bar.....because "Invalid quantifier ?" .Please correct and retry'

    Input:

    {
    "tags": "This is an example, shipmentId:123456"
    }


    Handlebars:

    {{#contains tags "shipmentId" }}
    {{regexMatch tags "(?<=shipmentId:)\d+" "g"}}
    {{else}}different_id{{/contains}}

    Desired output:

    {
    outputId: "123456"
    }

    When I run the following in the browser, the regex does give me the correct output:

    const regex = /(?<=shipmentId:)\d+/;
    const tags = "This is an example, shipmentId:123456";
    console.log(tags.match(regex));

    I've tried a combination of different regex expressions, including and excluding the global flag and still nothing, it doesn't get past the '?'.

    0
  • Pablo Gonzalez
    Celigo University Level 4: Legendary
    Engaged

    Also, it seems to be happening in NetSuite flows, both from the marketplace (Shopify -> NetSuite) and custom flows using NetSuite as an import.

    0
  • Tyler Lamparter Principal Product Manager
    Awesome Follow-up
    Engaged
    Top Contributor
    Answer Pro
    Celigo University Level 4: Legendary

    Pablo Gonzalez is this only happening on NetSuite steps? This seems to be working in playground.

    0
  • Tyler Lamparter Principal Product Manager
    Awesome Follow-up
    Engaged
    Top Contributor
    Answer Pro
    Celigo University Level 4: Legendary

    Pablo Gonzalez it looks like this error happens in preview, but it works in runtime. I'll pass this on internally, but you should be good to use it.

    0

Please sign in to leave a comment.