I'm trying to build a regex that restricts a string for no more than 5 consecutive numeric characters and no more than 8 numeric characters in total.
For example :
- 12345 => True
- Yograj => True
- Yograj123456 => False
- 12345Yograj => True
- 12345Yograj12345 => True
- Yograj123456Yograj => False
- Yograj123Varsolkar456789 => False
- 123Yograj45678Varsolkar => True
- A1B2C3D4e5f6g7h8i9j0 => False
- Yograj 890 Varsolkar 78455 => False
I was able to create this till now: /^((\d{0,5}[a-zA-Z]+\d{0,5})+|\d{0,5})$/
Many thanks in advance