cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sgokul95
Helper I
Helper I

Regex Validation for file path

Hi Team,

 

I want to validate a file path like below in the text box? 

 

Example: The file extension may be anything.

 

"file://Test\JBC\work.pdf"

 

I tried the below regex with the IsMatch but I couldn't succeed. 

 

 

IsMatch("file://Test\JBC\work.pdf", "file:[\w\./-:-!]+")

 

 

Can anyone help me with the regex? @RandyHayes @Pstork1 @CNT 

 

Regards,

Gokul 

2 REPLIES 2
phipps0218
Super User
Super User

Your current RegEx is only retrieving the following:

phipps0218_0-1657609445043.png


Let me get you the correct expression.

I am not an expert at RegEx but this will work:
file:[\w\./-:-!]+[\W\./-:-!]+[\w\./-:-!]+[\W\./-:-!]+[\w\./-:-!]{4}.pdf

 

 

Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful as can help others.

LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/
YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg
Twitter: https://twitter.com/phipps0218

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,816)