I am trying to get JJ01G3C5-10A6S0
out of :
\\JJ01G3C5-10A6S0\C$\2015\Mar\24\
with
Regex reg = new Regex("[^\\\\].+\\");
Note: I cannot assume that the value will be specifically in this format, so the only way for me to terminate the string is to assume that it starts with double backslash \\ then some data ... and then terminated by one backslash \
However this throws me:
Unhandled Exception: System.ArgumentException: parsing
"[^\\].+\"
- Illegal\
at the end of pattern.
Is there no way to have backslash as regex terminator?