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

Popular posts from this blog

objective c - Can't build GCM with Protobuf in Xcode -

ember.js - EmberJS Model find not up-to-date with underlying store -

embed HTML within ASP.net -