Hi Team,
I want to validate a file path like below in the text box?
Example: The file extension may be anything.
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
Your current RegEx is only retrieving the following:
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
User | Count |
---|---|
247 | |
106 | |
82 | |
50 | |
43 |