[Top][All Lists]

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

Re: How to search for any quoted-insert ctrl character

From: Teemu Likonen
Subject: Re: How to search for any quoted-insert ctrl character
Date: Sat, 30 Jan 2016 20:35:17 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.90 (gnu/linux)

Deric Bytes [2016-01-30 10:11:39-08] wrote:

> I want to do a re-search-forward for any ^ charcter, even if it is a
> quoted-insert symbol
> The following expression will not see text that has been entered using
> 'quoted-insert'
>    (re-search-forward "^")
> I want it to match the following three quoted-insert characters (and all 
> others)
> ^R
> ^T
> ^P

Whey you type C-q C-r you don't get ^ character but the Control+R
character (Unicode U+0012). It's just displayed as ^R. When you want to
search for those characters you need to put them literally in your
regexp string:

    (re-search-forward "[^R^T^P^]")

Use C-q C-r, C-q C-t and C-q C-p to insert them.

/// Teemu Likonen   - .-..   <> //
// PGP: 4E10 55DC 84E9 DFF6 13D7 8557 719D 69D3 2453 9450 ///

Attachment: signature.asc
Description: PGP signature

reply via email to

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