homepage Welcome to WebmasterWorld Guest from 23.22.76.170
register, login, search, subscribe, help, library, PubCon, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Visit PubCon.com
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.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
WebmasterWorld ® and PubCon ® are a Registered Trademarks of Pubcon Inc.
© Pubcon Inc. 1996-2012 all rights reserved