Using VI how can I search and replace the following statement?
3 answers
vim requires dumping back + (or use * instead). Also, you need a backslash bracket in vim. Thus:
:%s/\/\*\!\d\+\(.*\)\*\//\1/g
Yes, vim old-style posix regexes suck: /
Edit: As mentioned in the comments below, + works if selected as \ +. And \ d is indeed supported, oops. Edited the regex example to fix this. Also see Brian Carper's example for a more concise and readable version.
+4
source to share