|Too many $. In all the regex engines I use (I don't do PowerShell),
$ matches the end of the input string. I forgot that off my original answer, sorry. It should be there to disallow trailing garbage.
Similarly you probably need a
^ at the start to match start of string.
* means "0 or any number of occurrences of the previous item"
+ means "1 or more occurrences..."
? means "0 or 1 occurrences..."
. matches any character, so to match a literal period, you need to escape it with
So your regex should finally be
only adding whatever delimiters and escapes are required by PowerShell (which should probably be just
' ' around the whole exprerssion).
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012