G
G
GONJY MONJY2020-05-29 15:41:09
Regular Expressions
GONJY MONJY, 2020-05-29 15:41:09

Regular expression for Yii2 password?

Good afternoon! I just started working on Yii2, and more specifically, I'm learning.
There is a question: how to set 'match pattern' for the password, using the condition from the picture?
5ed102c3b94dd518969424.jpeg
Very urgent! Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2020-05-29
@GONJY_MONJY

The presence of at least two digits, two letters and two special characters is checked.
Length is at least 6 characters.

'pattern' => '(^(?xi)
                (?=(?:.*[0-9]){2})
                (?=(?:.*[a-z]){2})
                (?=(?:.*[!"#$%&\'()*+,./:;<=>[email protected]\[\]^_`{|}~-]){2})
                .{6,}$
              )'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question