views:

51

answers:

1

Hi,

I am looking for validating a textbox in my asp.net application for a valid file path like

  1. \\127.0.0.1\folder
  2. http://ftp.google.com and all other valid file paths
A: 

Indeed, it can be solved using Regex, but too complex for such a task, and it is slow. In my opinion, the best solution for your problem is not regex. You can easily validate file path by utilizing built-in ASP string functions, such as InStr, Left, Right, Mid, Len, etc.

Good Resource to Read:

Vantomex