Skip to main content

Notifications

Building Copilot Studio Chatbots in Microsoft T...
Unanswered

Need help with the RegEx in pva

Posted on by 10

Hello there, 

Forgive me for maybe asking in the wrong place, but I have been struggling with writing the Regex for what should be a very simple entity in microsoft PVA. 

I'm trying to create an entity that searches for a pattern of 'Z.123456' with the Z being case-insensitive. So far, everything points towards (?i)[Z.][0-9]{6} being the right pattern, but sadly it's only returning the result when I input a lowercase z. I have been trying this for the better part of a week without any succes. What am I doing wrong here?

Thank you in advance

Categories:
  • Expiscornovus Profile Picture
    Expiscornovus 1,700 on at
    Re: Need help with the RegEx in pva

    Hi @Pstork1,

     

    Yes, I am actually Dutch and unaware that this is a thing in my native language 😁

     

    I have tried that new pattern and also a couple of other ones but that didn't make a difference. Very strange issue 😆

  • Pstork1 Profile Picture
    Pstork1 1,990 on at
    Re: Need help with the RegEx in pva

    I'm wondering if the period is somehow a special character in certain languages/regions.  It would be good to try the pattern without the period and see if it makes a difference.  Perhaps try 

    (?i)Z\.[0-9]{6}
  • Expiscornovus Profile Picture
    Expiscornovus 1,700 on at
    Re: Need help with the RegEx in pva

    Hi @CooolinG & @Pstork1,

     

    Don't know if it helps.

     

    But I can reproduce the issue when I create a bot with the same custom regex entity and pattern within a PVA with Dutch (NL) language.

     

    When I create the entity in a PVA with English (US) language the regex pattern (?i)Z.[0-9]{6} works fine with Z.123456.

     

  • CooolinG Profile Picture
    CooolinG 10 on at
    Re: Need help with the RegEx in pva

    I suppose I'm just giving up on PVA then. Even your last suggestion does not yield results.. It must be something within my PVA settings, because as we've tested, every solution that SHOULD work, sadly doesn't. Thanks for all your help so far. I hope there's a solution to be found somewhere.

  • Pstork1 Profile Picture
    Pstork1 1,990 on at
    Re: Need help with the RegEx in pva

    It looks like you are using the exact same pattern and steps that I am and it works perfectly for me.  Unless the separators or punctuation are different in Europe, and I don't think it is for Regex, I don't see why its not working for you.  Especially since it recognizes the lower case z but not the Uppercase one.

     

    The other pattern you could try would be 

    [z,Z].[0-9]{6}

    It doesn't use the case insensitive option.  Instead it says it starts with either a z or Z, followed by a period and 6 digits.

     

  • CooolinG Profile Picture
    CooolinG 10 on at
    Re: Need help with the RegEx in pva

    It does recognize results with a lowercase 'z', if that information helps in any way.

  • CooolinG Profile Picture
    CooolinG 10 on at
    Re: Need help with the RegEx in pva

    Is this what you mean by authoring canvas?

    CooolinG_0-1641914050863.png


    And this by configuration of my regex entity? Pardon me but I'm not an english native so I might misinterprit some things.

    CooolinG_1-1641914116463.png

     

  • Pstork1 Profile Picture
    Pstork1 1,990 on at
    Re: Need help with the RegEx in pva

    Can you show me the configuration of your Regex entity and the authoring canvas where you are checking.  The message is the same as the one I get when I enter a value that doesn't match the regex expression.

  • CooolinG Profile Picture
    CooolinG 10 on at
    Re: Need help with the RegEx in pva

    How strange.. I'll add some screenshots too, to show you what I mean. Excuse it being in another language, but here they are:

    My return message. Translated it say something along the lines of: "Unfortunately, I didn't understand that." And then it asks again.

    CooolinG_0-1641913220908.png


    This is my Entity regex:

    CooolinG_1-1641913318047.png


    I'm really not seeing what I am doing different from you. Apologies.



  • Pstork1 Profile Picture
    Pstork1 1,990 on at
    Re: Need help with the RegEx in pva

    I tested and it works for me.  Here's my Regex entity

    image.png

    And here's the testing of the bot with an unsuccessful run and two successful entries.

    image.png

     

Helpful resources

Quick Links

Exciting News for Copilot Studio Communi…

Get ready to experience a whole new level of engagement with the Copilot Studio…

Celebrating the May Super User of the…

LaurensM is an exceptional contributor to the Power Platform Community…

Check out the Copilot Studio Cookbook…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
renatoromao Profile Picture

renatoromao 6,459

#2
Pstork1 Profile Picture

Pstork1 1,990

#3
Expiscornovus Profile Picture

Expiscornovus 1,700

Featured topics