Thanks ygemici, but the {7} is doing a fixed set of characters at the beginning of the string, is there any way just to extract the last set of digits, without fixing the initial character set.
The above matches the longst string which ends in something which is not a member of [0-9]. It substitutes the match with "nothing". Thus it returns the rest of the line.
More precise would be to force it to start from the start of the line.
Hi Ed
sed does not parse your expression for dynamic strings
if you has fixed string then it can be write with sed.
however you can use grep for your needs more sensiblely
echo "ab01cde234"|grep -o "[0-9]*$"
234
if you want to use sed , maybe you can try like this
echo "ab01cde234" | sed 's/.*[a-zA-Z]\([0-9][0-9]*\)[A-Za-z]*/\1/g'
234
or
echo "abca121a1b01cde23412zxxx1212aa" | sed 's/.*[a-zA-Z]\([0-9][0-9]*\)[A-Za-z]*/\1/g'
1212
this expression only make this examples not global!.
for example
echo "ab01cde234AA" | sed 's/.*[a-z]\([0-9]*\)$/\1/g'
ab01cde234AA