Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Copilot Studio - Building Copilot Studio Chatbo...
Unanswered

Need help with the RegEx in pva

(0) ShareShare
ReportReport
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

  • Expiscornovus Profile Picture
    32,112 Most Valuable Professional 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
    67,039 Most Valuable Professional 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
    32,112 Most Valuable Professional 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
    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
    67,039 Most Valuable Professional 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
    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
    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
    67,039 Most Valuable Professional 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
    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
    67,039 Most Valuable Professional 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

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 169 Super User 2025 Season 1

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 150

#3
sandeep_angara Profile Picture

sandeep_angara 75

Featured topics