Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Java 8

"
\s(?=\w*[0-9])(?=\w*[A-Z])([A-Z\d]{11}|[A-Z\d]{7})\s
"
g

Description

Regex to capture AlphaNumeric String

  • Length should be 7 or 11
  • Must contain at least one Alphabet
  • Must contain at least one Numeric
Submitted by Suman Maharjan - 3 years ago