regex - Matching zero or more characters in sed -
i practicing commands using sed when confused output of following command:
echo 'first:second' | sed 's_[^:]*_(&)_g'
my question is: why command wrap string "first" , "second" in parentheses?
shouldn't colon wrapped since specified "zero or more non-colons" in regex condition?
please clarify.
you use
[^:]
which searches characters except :
. experience normal comportment.
Comments
Post a Comment