Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Need regex for below password policy

Diptansu11
New Contributor III
New Contributor III

Requirement:

1. Best practice is to include alpha, numeric and special characters, upper-case and lower-case
characters.

2. password should be created with a pre-fix of $0 and exclude uppercase and lower case I O L as well as exclude the following special characters  ^, <, &, >, ", %, $, #, {, }, (, ) 

 

Can you please help with a working regex for this. 

6 REPLIES 6

PratithShetty
New Contributor II
New Contributor II

Hi @Diptansu11 
^(?!.*[IiOoLl^<\&>"%$#{}()])[A-HJ-N-Za-hj-n-z0-9]{2}\$0.*$

If this works , please mark this as the solution.


In this regex where we are setting the "pre-fix of $0" part ?

^\$0[A-HJ-NP-Za-km-z0-9!@*?&]*$


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

@Diptansu11 Is this issue resolved ?


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

PratithShetty
New Contributor II
New Contributor II

Hi @Diptansu11 - I have made the part bold which sets the prefix.

^(?!.*[IiOoLl^<\&>"%$#{}()])[A-HJ-N-Za-hj-n-z0-9]{2}\$0.*$

^ asserts the start of the string.
(?!.*[IiOoLl^<\&>"%$#{}()]) is a negative lookahead ensuring that the characters you want to exclude are not present in the password.
[A-HJ-N-Za-hj-n-z0-9]{2} matches any combination of two characters except the excluded ones.
\$0 ensures that the password starts with $0.
.* matches any characters that follow.
$ asserts the end of the string.

Thanks.

 

Manu269
All-Star
All-Star

@Diptansu11 validate this

^\$0[A-HJ-NP-Za-km-z0-9!@*?&]*$

Regards
Manish Kumar
If the response answered your query, please Accept As Solution and Kudos
.