Hey guys I'm new to regex and I want to create 1 single regex that matches with texts that are
- 5-30 letters long,
- have no special characters,
- have at least 4 capital letters,
- have at least 2 lowercase letters and
- at least 1 number.
Examples: should match
https://stackoverflow.com/Abcde3FGhiDE/Zyx23
should match:Abcde3FGhiDE
|a|b|c|AbcdEFGH123|456Ac
should match:AbcdEFG123
P A Abcde3FGhiDE Z H
should match:Abcde3FGhiDE
ZZ123!Abcde3FGhiDE!123
should match:Abcde3FGhiDE
Examples: no match
<HeLLoWoRlD"123
|A|b|c|D|E|F|1|
NULLLLLLLLLLLLLLLLLLLLLLllll 1
IAMoverTHELIMITTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT3
Please make it as concise as you can. My attempt (demo):
(?=(?:\d*[A-Za-z]))(?=(?:\S*?[A-Z]){4,}\S*?$)(?=(?:[a-zA-Z]*\d))[A-Za-z0-9]{5,30}