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

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -