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
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (5,082)