Jordi Castillo
Jordi Castillo

Reputation: 693

Regular expression which 3 characters or more, min one minus, max 3 numbers

I need the following regular expression:

I try the following regular expression:

/^(?=.*[A-Za-z]{3,})(?=.*[a-z]{1,})(?=.*[0-9]\d{0,3})(u{1})[A-Za-z0-9\d]{9,12}$/

One example valid: aA2ca13ú}

Upvotes: 0

Views: 297

Answers (1)

Pushpesh Kumar Rajwanshi
Pushpesh Kumar Rajwanshi

Reputation: 18357

You can use this regex that should meet your requirements,

^(?=[^A-Za-z]*(?:[A-Za-z]+[^A-Za-z]*){3,})(?=\D*\d?\D*\d?\D*\d?\D*$)(?=[^ú]*ú[^ú]*$)[úa-zA-Z\d-]{8,11}[#}.]$

Demo

Let me know if any of your case fails.

Upvotes: 2

Related Questions