Need assistance with regex -



Need assistance with regex -

for regex, want letters a-z 1-4 times followed digit 4-7 times. combination of these 2 should have 8 characters total.

([a-z]{1,4}[0-9]{4,7}){8}

i know wrong. can tell me right regex look create work

you can utilize lookahead based regular look assert string length 8 characters.

^(?=.{8}$)[a-z]{1,4}\d{4,7}$

explanation | live demo

regex

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -