VIM regular expression

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

Post Reply
phpist
Forum Newbie
Posts: 7
Joined: Wed Feb 22, 2006 4:03 am
Location: istanbul_TR

VIM regular expression

Post by phpist »

Hello everyone,
I have a bothersome problem here with a huge XML file. The creator of XML file is using UTF-16 character set and some special characters are included to the file. My problem is starting at right here.
I have tried to replace special characters with Regular Expression in VIM. But doesn't work and getting that error:

E488: Trailing characters

Here is the regular expression:

s 1,$ s/^v//g

I'm not sure about the regular expression above. Do i something wrong?

Thank you for your time.

Umut
User avatar
ReverendDexter
Forum Contributor
Posts: 193
Joined: Tue May 29, 2007 1:26 pm
Location: Chico, CA

Post by ReverendDexter »

Well, for Vim, you shouldn't be doubling up on the 's'

try :%s/^v//g

though, admittedly, I'm not sure what the ^v is here, unless you're meaning ctrl-v, as in paste.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

ReverendDexter wrote:though, admittedly, I'm not sure what the ^v is here, unless you're meaning ctrl-v, as in paste.
String starting with 'v' ?
User avatar
ReverendDexter
Forum Contributor
Posts: 193
Joined: Tue May 29, 2007 1:26 pm
Location: Chico, CA

Post by ReverendDexter »

It's always gotta be the obvious, doesn't it? Heh... when I made that last post I had been staring at the Vim manual for about an hour...

So, og poster, did that help at all?
Post Reply