-1

I am trying to make a regex for the azure virtual machines admin passwords But it contains fault ones and the errors don't specify which ones are the fault ones and also on the azure portal there is no information on which characters you cant use

this is the regex:

[^!@$#%^&*()_+\-=\[\]{};'':"\\|,.<>\/? ]
Brynn
  • 97
  • 2
  • 13
  • Have you tried removing characters from your pattern 1 by 1 to see where it stops breaking? – No Refunds No Returns Nov 07 '18 at 13:44
  • I am busy with that right now. But i cant imagine that that is the only way to find this out – Brynn Nov 07 '18 at 13:45
  • 1
    probably ..but I would bet you lunch it's the fastest way. – No Refunds No Returns Nov 07 '18 at 13:57
  • You can refer to this [post](https://stackoverflow.com/questions/52837260/azure-cli-powershell-password-requirments) I answered before, some characters like " and [ and ] should have a prefix backquote, like `". – Ivan Glasenberg Nov 08 '18 at 01:42
  • @Ivan Yang I do still remember that post. The only thing is this isn't about a Regex error this is about that some of the characters in the regex that if i use those in the password ill get an azure error and that error doesn't give me details about which characters give the error. It could even be the @ token that azure doesn't like – Brynn Nov 08 '18 at 08:58
  • Ok... there is a password requirements [doc](https://learn.microsoft.com/en-us/azure/virtual-machines/windows/faq#what-are-the-password-requirements-when-creating-a-vm), not sure if it can help you. – Ivan Glasenberg Nov 08 '18 at 09:12
  • I did find this `Regex match [\W_]` and i think this is what i am trying to achieve but i'm not certain of it yet – Brynn Nov 08 '18 at 09:17
  • If you still not figure it out, I can open an ticket for MS's help :) – Ivan Glasenberg Nov 08 '18 at 09:36
  • I didnt figure it out yet. Do you know where i can make a microsoft ticket? – Brynn Nov 08 '18 at 10:36
  • I just made a support ticket – Brynn Nov 09 '18 at 10:27

1 Answers1

0

After a Microsoft Support ticket, the Microsoft support told me that [\W_] should be what i am trying to achieve. it isn't perfect but it seems to work for now.

Brynn
  • 97
  • 2
  • 13