cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Boon-1
Helper III
Helper III

Checking string of certain format

Hi all,

 

I am not very good with string. I wanted to check if the string contains the following format "AA1-SNN-MMYY" where "AA" represent any 2 letters from A to Z, SNN should be in number e.g. 001, 002, and MMYY is in number 0622 for jun and year 2022 in text input control before my "warning label" visibility goes from "true" to "false" How should the "if" formula be written to check if the text input contain the format required?

 

Thanks for reading and your help !    

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Community Support
Community Support

Hi @Boon-1 ,

 

Please try this on.

If(IsMatch(TextInput.Text,"\p{L}{2}1-\d{3}-(0?[1-9]|1[012])\d{2}"),truelogic,falselogic)

Snipaste_2020-07-06_14-58-30.png 

Hope this helps.

Sik

 

View solution in original post

1 REPLY 1
v-siky-msft
Community Support
Community Support

Hi @Boon-1 ,

 

Please try this on.

If(IsMatch(TextInput.Text,"\p{L}{2}1-\d{3}-(0?[1-9]|1[012])\d{2}"),truelogic,falselogic)

Snipaste_2020-07-06_14-58-30.png 

Hope this helps.

Sik

 

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (59,181)