Welcome to WebmasterWorld Guest from 54.227.101.214

Forum Moderators: open

Message Too Old, No Replies

Searching for question marks in VIM

     

thesheep

5:20 pm on May 23, 2006 (gmt 0)

10+ Year Member



How do I search for a string starting with a '?' in VIM (I want to replace it with )?

I've tried:

:% s/?//g and also :% s/\?//g to try and escape the special meaning of '?' but neither of these two work...

thesheep

12:38 pm on May 26, 2006 (gmt 0)

10+ Year Member



Nobody?...

coopster

12:55 pm on May 26, 2006 (gmt 0)

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Looks correct to me except for the space between the range and the search pattern, get rid of the space:
:%s/?//g

thesheep

1:09 pm on May 26, 2006 (gmt 0)

10+ Year Member



Hi, actually it seems that the space there doesn't make any difference.

But I think I'm figuring out what's going on. I've got a file written on Windows, with a bunch of pound signs in it. When I look at it in VIM on OSX, they show up as ?
But now I'm thinking that these are not actually question marks, they're the windows character code for the pound sign, which is probably what I need to search and replace.

Now I just need to find out how to do that...

 

Featured Threads

Hot Threads This Week

Hot Threads This Month