c# - Need Regex pattern to validate password pattern -
we need validate password against following pattern. “xabcdef99*” [1st char uppercase, 2nd 7th chars lowercase, 8th 9th digits , last char symbol ]
can provide me regex same? how can validate following password against regex in c#.
userpcs12* --> valid
testeur333 --> invalid (because last char not symbol)
userpcs12* --> invalid (because first char not uppercase)
you may try this,
^[a-z][a-z]{6}\d{2}[~!@#$%^&*]$
add symbols want inside last character class.
or
^[a-z][a-z]{6}\d{2}\w$
\w
matches non-word character. change [\w_]
if treat _
special charcater.
Comments
Post a Comment