I'm trying to limit user's input to a valid shared folder path like
\\\computer-name\drive\optional_folder1\optional_folder2\
I've tried to look around and around and make my own regex, but I can't find the perfect answer. This is my current regex:
^((\\{2})([A-Za-z -._]+)(\\{1})([A-Za-z -._]+))(\\{1}([A-Za-z .-_])+)*(\\?)$
Any hints will be appreciated.
Thanks, guys.
I've simplified it a bit:
^(\\)(\\[\w\.-_]+){2,}(\\?)$
So basically you want to have
^(\\) # start with slash
(\\[\w\.-_]+) # followed by group of slash and name
{2,} # which should be two or more times
(\\?)$ # last slash(es)