I have to match entirely all passwords containing at least four successive uppercase letters not immediately preceded by two or more successive digits. My initial method of doing this was to use (?<!\d{2,})
, but I got an error from re as it was a variable length negative lookbehind.
I have checked and can't find any solution to this on similar questions, as the usual advice is to just use the regex module, which is not an option for me. Additionally most other answers refer to using *
and +
, which isn't applicable for my problem. I've tried many variations of this but can't seem to get it to work.
The code I am using is below:
re.findall(r'((?<!\d){2,})([A-Z]{4,})