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

Winapi c++: DialogBox hangs when breaking a loop -

vb.net - Font adding using PDFsharp -

javascript - jQuery iScroll clickable list elements while retaining scroll? -