declare -a regex echo highest subscript of regex=${#regex} regex[${#regex}]='[_a-zA-Z0-9][[:alnum:]]*[[:blank:]]*()' echo highest subscript of regex=${#regex}
Produces: address@hidden junk# ./test highest subscript of regex=0 highest subscript of regex=38
address@hidden junk# bash --version bash --version GNU bash, version 4.2.20(1)-release (x86_64-redhat-linux-gnu)