[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: regexp help



* Jeff (jcoppock1@attbi.com) [020725 13:14]:
> I know there are regexp guru's here, so I figured I'd ask for help
> with at search & replace I need to do.  A number of text files I have
> are loaded with ^M and ^@ characters that I can't find the right
> regexp to find them in order to get rid of them.  I tried a bunch of
> things both direct and using special characters, but I can't get it
> right. 

This depends on what tools you're using. That also affect how the bytes
that are actually in the file in question are being displayed to you.

In vim, you can precede a control character with ctrl+v to enter it
literally into the editing buffer. For example, to get a ^M (carriage
return) you can hit ctrl+v ctrl+m, and vim will insert the CR character
(displayed as ^M on your screen). Similarly, the ^@ is probably a null
character, which can be entered in vim as ctrl+v 000 . Thus you see that
ctrl+v can also be used to enter any character by its decimal, octal, or
hex representation. For detailed help on how to use this feature, type
":help i_CTRL-V_digit". 

good times,
Vineet
-- 
http://www.doorstop.net/
-- 
"Extremism in the defense of liberty is no vice.
Moderation in the pursuit of justice is no virtue."  -- Barry Goldwater 

Attachment: pgp7BddesuS7z.pgp
Description: PGP signature


Reply to: