I have been trying learning regex for this task. I have used lookahead to find the three conditions.
- Check for lowercase
(?=.*[a-z]) - Check for uppercase
(?=.*[A-Z]) - Check for numeric
(?=.*[0-9])
This case work fine. When I combine I get
(?=.\*\d)(?=.\*[a-z])(?=.*[A-Z])
This return true for any string containing number, a-z and A-Z. But I need only regex containing alpha numeric. I tried this regex
^(?=.\*\d)(?=.\*[a-z])(?=.*[A-Z])$
But this does not work. Can anyone help on why does this regex not work for the combination.
Edit:
My doubt is why the ^ and $ do not work there when I combine