/(?=^\w{6,20}$)(?=\w*[A-Z])^\w+$/
a
aX
ab
aXb
abc
abXc
abcd
abcXd
abcde
abcdXe
abcdef
abcdeXf
abcdefg
abXcdefg
abcdefgh
abcXdefgh
abcdefghi
abcdXefghi
abcdefghij
abcdeXfghij
abcdefghijk
abcdefXghijk
abcdefghijkl
abcdefgXhijkl
abcdefghijklm
abcdefghXijklm
abcdefghijklmn
abcXdefghijklmn
abcdefghijklmno
abcdXefghijklmno
abcdefghijklmnop
abcdeXfghijklmnop
abcdefghijklmnopq
abcdefXghijklmnopq
abcdefghijklmnopqr
abcdefgXhijklmnopqr
abcdefghijklmnopqrs
abcdefghXijklmnopqrs
abcdefghijklmnopqrst
abcdefghiXjklmnopqrst
abcdefghijklmnopqrstu
abcdefghijXklmnopqrstu
NODE EXPLANATION
--------------------------------------------------------------------------------
(?= look ahead to see if there is:
--------------------------------------------------------------------------------
^ the beginning of the string
--------------------------------------------------------------------------------
\w{6,20} word characters (a-z, A-Z, 0-9, _)
(between 6 and 20 times (matching the
most amount possible))
--------------------------------------------------------------------------------
$ before an optional \n, and the end of
the string
--------------------------------------------------------------------------------
) end of look-ahead
--------------------------------------------------------------------------------
(?= look ahead to see if there is:
--------------------------------------------------------------------------------
\w* word characters (a-z, A-Z, 0-9, _) (0 or
more times (matching the most amount
possible))
--------------------------------------------------------------------------------
[A-Z] any character of: 'A' to 'Z'
--------------------------------------------------------------------------------
) end of look-ahead
--------------------------------------------------------------------------------
^ the beginning of the string
--------------------------------------------------------------------------------
\w+ word characters (a-z, A-Z, 0-9, _) (1 or
more times (matching the most amount
possible))
--------------------------------------------------------------------------------
$ before an optional \n, and the end of the
string