Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

String validation - use REGEX?

$
0
0

Hi all

I'm trying to figure out the best way to perfom validation on a string representing a UNC path.  I would like to check that the path has a fourth backslash and also has some characters after the fourth backslash, e.g.

\\blah\blah\blah = ok

\\blah\blah or \\blah\blah\ = not ok

"blah" could be anything.

Is regex the simplest way to go with this or is there an easier way?


Alexei


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>