Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • \$\begingroup\$ I actually had to wrap the $args[...]..' in () to be able to get it to resolve. Otherwise it was always True. \$\endgroup\$ Commented Nov 4, 2015 at 21:11
  • \$\begingroup\$ @JonathanLeech-Pepin Interesting - likely a versioning difference in how operations are ordered. I primarily code in PowerShell v4 (using the ISE); what were you using? \$\endgroup\$ Commented Nov 4, 2015 at 21:27
  • \$\begingroup\$ Happened on Win7 with the latest 5.0 rtm (August), also happens on Win10 with built-in. It is not however an issue with the pipeline version. On the other hand: param($a)$a-match'^(?!(..+)\1+$)..' works and is exactly 35 bytes as well. \$\endgroup\$ Commented Nov 4, 2015 at 21:40
  • \$\begingroup\$ @JonathanLeech-Pepin Indeed -- I just tested and confirmed on a Windows 7 machine. How strange. Yay for undocumented features :-/ ... I've corrected the code with the param($a) iteration, which should work on any version. Thanks for the assist! \$\endgroup\$ Commented Nov 4, 2015 at 21:56