I have a generated code within an email that I need to match. It will always be 6 characters long and must contain a minimum of one number and one letter. The order of numbers and letters will vary each time. I'm really new to regex.
Here is a few examples of codes I have received that I need to pull from the body of an email:
q295zp
gd5z9r
ktsft5
mz3jr4
I have tried these and countless more but continue to match the codes above as well as 6 letter words.
[a-z1-9]{6}
([a-z]+[1-9]+){6}
How do I make it only match 6 letter sequences that have at least one letter and one number?