Hellow everyone... i have to validate a my folderpath field... could you people suggest any reqular expression to validate a valid path... that field should not accept input like “My Documents” but should accept “c:\Backup”

You're going to have to be a little more precise: what is it that you are trying to ensure? No spaces, no special characters, absolute paths only, something else ? Also what about platforms where paths are delimited in different ways ? What will you be doing with this path ?


Frederick Cheung wrote:

Newb Newb wrote: [...]

in that folder path location i m going to save files.

On the client side? For security reasons, Web applications don't have direct access to the client-side filesystem. You'll have to give the client a download link and let the browser program take care of saving it

OTOH, if this is on the server side, you can construct the path in a way that you know will be valid.

In either case, there is *no point* to the validation you're trying to do.

and i m on windows ...

Doesn't mean your clients will be, so you can't only accept Windows-style paths!

Really, there's no validation that can do what you want here.