I am trying to do a search and replace on a large database file where some of the urls are escaped and some not, e.g.:
http://www.example.com
http:\\/\\/www.example.com
I thought I could use a simple character class in a regex like this:
%s~http\(:[/\\]+www.example.com\)~https\1~g
But won't work no matter how I escape it. Can I use character classes in vim search and replace? If not, how can I match the url so that any amount of backslashes and forward slashes are matched?
[/\\]
and+
.+
just means a literal plus sign,\+
is used for repetition of the preceding atom.