help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: displaying control characters/regex help


From: Kevin Rodgers
Subject: Re: displaying control characters/regex help
Date: Thu, 09 Nov 2006 11:59:34 -0700
User-agent: Thunderbird 1.5.0.8 (Windows/20061025)

Peter wrote:
Hi - I'd like to know if Emacs has the ability to display control
(non-printing) characters (as in Word, where it is possible to hit a
button and see representations of all the non-printing characters).

See the Text Display node of the Emacs manual, and follow its reference
to the Display Tables node of the Emacs Lisp manual and its subnodes.

I
may not actually need it for the problem I'm working on, but it would
be nice to know - what I'm actually trying to accomplish is a global
search-and-replace...I'm looking to replace:
>
Any amount of whitespace (spaces, tabs, carriage returns), followed by
either one or two digits, followed by any amount of whitespace,
followed by a fixed string, followed by (possibly) more
whitespace. There would be regular text (word characters) on either
side of this regex region. (I'm trying to clean up a document that was
saved-as-text from Acroread, that had a page number and a fixed footer
on each page).

Sample:

-----boundary-----

34


My string is quite stringy.


-----boundary-----

I want to replace the entire mess between the boundaries with just a
carriage return.

C-M-% \s-*[0-9]\{1,2\}\s-*My SPC string SPC is SPC quite SPC stringy \s-* RET C-q C-j RET

If you want to match the fixed string exactly, use `C-q SPC' instead of
just `SPC'.

--
Kevin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]