homepage Welcome to WebmasterWorld Guest from 54.227.56.174
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / WYSIWYG and Text Code Editors
Forum Library, Charter, Moderator: open

WYSIWYG and Text Code Editors Forum

    
Searching for question marks in VIM
thesheep




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

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




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

Nobody?...

coopster




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

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

thesheep




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

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...

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / WYSIWYG and Text Code Editors
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved