hello,
I want to check in bash shell if a string on VAR does not begin with "-" and at the same time if the string is built of [-_a-zA-Z0-9] but not longer than specified on LEN variable
LEN=10
[[ $VAR =~ ^[_a-zA-Z0-9][-_a-zA-Z0-9]{1,${LEN}}$ ]]
how to test length of whole marked in red is not greater than $LEN?
I want to check in bash shell if a string on VAR does not begin with "-" and at the same time if the string is built of [-_a-zA-Z0-9] but not longer than specified on LEN variable
LEN=10
[[ $VAR =~ ^[_a-zA-Z0-9][-_a-zA-Z0-9]{1,${LEN}}$ ]]
how to test length of whole marked in red is not greater than $LEN?