Would anyone be able to tell me how to pull the server name out of a UNC?
ex.
//servername/directory/directory
Edit : I apologize but it looks like I need to clarify a mistake: the path actually is more like:
//servername/d$/directory
I know this might change things a little
Just another option, for the sake of showing different options:
The server name will be in
\0
or$0
or simply the result of the function, depending on how you call it and what your language offers.Explanation in regex comment mode:
Regular expression to match
servername
:How about
Uri
:Ugly but it just works:
This should do the trick.
The server name is in the first capturing group