Definition Group(?(DEFINE)
(?<lc>(?=[^a-z\n]*[a-z])) # lowercase
(?<uc>(?=[^A-Z\n]*[A-Z])) # uppercase
(?<digit>(?=[^\d\n]*\d)) # digit
(?<special>(?=.*[!@]+)) # special character
) Group lc(?<lc>(?=[^a-z\n]*[a-z])) Positive Lookahead(?=[^a-z\n]*[a-z]) Negated Character Class[^a-z\n]* *matches any number of characters outside the set below:
a-zone character from a (9710) to z (12210) (case sensitive)
\na line-feed (newline) character (ASCII 10)
a-zone character from a (9710) to z (12210) (case sensitive)
Comment: lowercase
Group uc(?<uc>(?=[^A-Z\n]*[A-Z])) Positive Lookahead(?=[^A-Z\n]*[A-Z]) Negated Character Class[^A-Z\n]* *matches any number of characters outside the set below:
A-Zone character from A (6510) to Z (9010) (case sensitive)
\na line-feed (newline) character (ASCII 10)
A-Zone character from A (6510) to Z (9010) (case sensitive)
Comment: uppercase
Group digit(?<digit>(?=[^\d\n]*\d)) Positive Lookahead(?=[^\d\n]*\d) Negated Character Class[^\d\n]* *matches any number of characters outside the set below:
\da digit
\na line-feed (newline) character (ASCII 10)
\da digit
Comment: digit
Group special(?<special>(?=.*[!@]+)) Positive Lookahead(?=.*[!@]+) .*any character (except for line terminators), repeated any number of times
+matches at least one character from the set below:
!the literal ! (3310 / 418 / 2116)
@the literal @ (6410 / 1008 / 4016)
Comment: special character
^start of line
(?&lc)calls group lc as a subroutine
(?&uc)calls group uc as a subroutine
(?&digit)calls group digit as a subroutine
(?&special)calls group special as a subroutine
.{6,}any character (except for line terminators), repeated at least 6 times
$end of line
g modifier: global. Finds all matches instead of stopping after the first
m modifier: multiline. Causes ^ and $ to match the start and end of each line, not only the start and end of the string
x modifier: extended. Ignores unescaped whitespace and comments outside character classes