question

SakeriyeMohamud-4520 avatar image
0 Votes"
SakeriyeMohamud-4520 asked SakeriyeMohamud-4520 edited

Guid Regex

hi i would like some help to validate a pattern before releases

azure-ad-passwordless-authentication
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Givary-MSFT avatar image
1 Vote"
Givary-MSFT answered Givary-MSFT edited

@SakeriyeMohamud-4520

Thank you for reaching out to us.

As i understand you are looking for regex to validate this pattern "04e01ea8-c88a-4835-a4ed-0db65ea31dbd"

Researched and tested in my lab, find the below regex to validate the same.

"04e01ea8-c88a-4835-a4ed-0db65ea31dbd" -match '(?im)^[{(]?[0-9A-F]{8}[-]?(?:[0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$'

190861-image.png



Reference:
https://www.geeksforgeeks.org/how-to-validate-guid-globally-unique-identifier-using-regular-expression/
https://tech.nicolonsky.ch/validating-a-guid-with-powershell/


Let me know if you have any questions.

Please remember to "Accept Answer" if answer helped, so that others in the community facing similar issues can easily find the solution.



image.png (14.7 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.