I am trying to write a regex to find a string contains words with both letters and digits (NOT A CHECK FOR ALPHANUMERIC because word should strictly contain both letters and digits). I have come up with this ^(?=.*[a-zA-Z])(?=.*[0-9]) Here's the link to the above regex: https://regex101.com/r/Y97ykL/1 Above regex works for simple scenarios like below a1b4cc -> true (contains both letters and digits) abc -> false (contains only letters) 123 -> false (contains only digits) But there are few scenarios which I am not able to cover with the above regex. How can I update my above regex to also work for the below examples? abc d77hv -> True ( Since efg123 contains both letter and digits) 798 h7ghd -> True (Since h7ghd contains both letters and digits) 798 abcd -> False (Since there is no word containing both letter and digits) I am not too familiar with regex but is it possible to write a regex to do the check for the above described scenarios without iterating over each word in a string? Thanks for the help! Continue reading...