I need to match a pattern as follows with the added limitation that the match must be exactly 7 characters long: /^\d*[a-zA-Z]\d*$/ In words, this is a 7 character sequence of 6 digits and one alphabetic character in any order. How do I limit the overall length to 7 using regex? Thanks!