Use [[ "123abc456" =~ ([0-9]*)([a-z]*)([0-9]*) ]] to parse a string via regex; echo ${BASH_REMATCH[0]} for what matched; pieces in [1], ..
0
1
2
0
0