tags:

views:

84

answers:

1

I'm being an idiot.

Someone cut and pasted some text from microsoft word into my lovely html files.

I now have these unicode characters instead of regular quote symbols, (i.e. quotes appear as <92> in the text)

I want to do a regex replace but I'm having trouble selecting them.

:%s/\u92/'/g
:%s/\u5C/'/g
:%s/\x92/'/g
:%s/\x5C/'/g

...all fail. My google-fu has failed me.

+4  A: 

from :help regexp, you need to use some specific syntax to select unicode characters with a regular expression in Vim.

|/\%d|  \%d \%d match specified decimal character (eg \%d123)
|/\%x|  \%x \%x match specified hex character (eg \%x2a)
|/\%o|  \%o \%o match specified octal character (eg \%o040)
|/\%u|  \%u \%u match specified multibyte character (eg \%u20ac)
|/\%U|  \%U \%U match specified large multibyte character (eg \%U12345678)
michaelmichael
thanks! "rtfm" as they say... :)
aidan