Skip to main content
edited tags
Link
Kusalananda
  • 355.8k
  • 42
  • 735
  • 1.1k
Source Link
Cruise5
  • 546
  • 1
  • 10
  • 30

How to quantify POSIX extended regex?

  1. Password should start with a capital (uppercase) letter
  2. Password should contain a lower-case letter
  3. Password should contain a number
  4. Password length should be a minimum of 8 and less than 16 characters

I want to use POSIX character classes in a bash script and I have following (it doesn't work). I don't know how to group so that I can meet the length condition.

^[[:upper:]][[:lower:]]+[[:upper:]]*[[:digit:]]+$ Where should {8,15} go?