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
  • You have a problem with writing the correct string literal, if you say the regex works, it is not a problem with regex. Please post the string literal you used in PS code. Commented Aug 1, 2022 at 21:02
  • 2
    Instead of building a complex catch-all regex, consider using several tests to see if the string matches the conditions. That way you can easily tell the user that, say, there wasn't this or that char instead of just saying that it wasn't complex enough. Commented Aug 1, 2022 at 21:09
  • I've done it for you here, but in the future please format your post properly. Commented Aug 1, 2022 at 21:20
  • @WiktorStribiżew, not knowing how to construct the string literal in PowerShell is precisely the OP's problem. Commented Aug 1, 2022 at 21:27