i want to substitute the text 'which apt'
to $(which apt)
.
:s/'\&.*'/$(\0)
does substitute to $('which apt')
. How can i leave those single quotes out on the substitution, so that just $(..) appears?
EDIT
:s/'\zs\&.*\ze'/$(\0)
results in $('which apt)'
. Although the regex should match any character between the two ', as i marked them as outside of the selection. i don't know if i did sth wrong?
\zs
and\ze
. See:help \zs
.\&
doesn't do what you think it does...although I don't know exactly what you think it does. :)