$ echo "123 123 abc abc" | sed 's/[0-9]*/(&)/'
(123) 123 abc abc
In this example, your requirement is to put parentheses around your matched/searched string. So I put '&' as the replacement for the searched string, which is any series of number between 0 to 9, and put parentheses around it.
Done :)
Done :)
No comments:
Post a Comment