Just have a negative lookahead like this to disallow all 0s:
/^(?!0{6})[A-Z0-9][0-9]{5}$/
More Related Contents:
- How can I match “anything up until this sequence of characters” in a regular expression?
- bash regex with quotes?
- Regular expression to match any character being repeated more than 10 times
- Parsing scientific notation sensibly?
- Regex Last occurrence?
- Regular expression to match string starting with a specific word
- How to wisely combine shingles and edgeNgram to provide flexible full text search?
- Regular expression negative lookahead
- Why is a character class faster than alternation?
- Mail::RFC822::Address Regex
- Regular Expressions- Match Anything
- How to Use/Enable (RegExp object) Regular Expression using VBA (MACRO) in word
- What is the Regular Expression For “Not Whitespace and Not a hyphen”
- Find numbers after specific text in a string with RegEx
- Regex for time in hh:mm am/pm format
- Email validation using regular expression in JSF 2 / PrimeFaces
- Grammatical inference of regular expressions for given finite list of representative strings?
- Regex get domain name from email
- Regex with replace in Golang
- Regex empty string or email
- Using sed and grep/egrep to search and replace
- Regular Expression to exclude set of Keywords
- Remove square brackets from a string vector
- regex: find one-digit number
- Regular Expression – How to find a match within a match?
- extract number after specific string
- Remove everything except a certain pattern
- RegEx for allowing alphanumeric at the starting and hyphen thereafter
- How does the ? make a quantifier lazy in regex
- How does \b work when using regular expressions?