Guys, I need to search and replace an alphanumeric string using SED.
Search String: Test:rXXXXX, where XXXXX will always be a 5 digit number
Replace String: Test:rYYYYY, where YYYYY will always be a 5 digit number
I have come up with the following :
echo 'Test:r12345' | sed 's/Test:r[0-9][0-9][0-9][0-9][0-9]$/Test:rYYYYY/g'
This works currently.
Is there a better way to achieve this? I don't want to use '[0-9]' 5 times in the expression