all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to search for any quoted-insert ctrl character
@ 2016-01-30 18:11 Deric Bytes
  2016-01-30 18:35 ` Teemu Likonen
  2016-01-30 19:00 ` Deric Bytes
  0 siblings, 2 replies; 3+ messages in thread
From: Deric Bytes @ 2016-01-30 18:11 UTC (permalink / raw)
  To: help-gnu-emacs

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




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to search for any quoted-insert ctrl character
  2016-01-30 18:11 How to search for any quoted-insert ctrl character Deric Bytes
@ 2016-01-30 18:35 ` Teemu Likonen
  2016-01-30 19:00 ` Deric Bytes
  1 sibling, 0 replies; 3+ messages in thread
From: Teemu Likonen @ 2016-01-30 18:35 UTC (permalink / raw)
  To: Deric Bytes; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 836 bytes --]

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   - .-..   <https://github.com/tlikonen> //
// PGP: 4E10 55DC 84E9 DFF6 13D7 8557 719D 69D3 2453 9450 ///

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to search for any quoted-insert ctrl character
  2016-01-30 18:11 How to search for any quoted-insert ctrl character Deric Bytes
  2016-01-30 18:35 ` Teemu Likonen
@ 2016-01-30 19:00 ` Deric Bytes
  1 sibling, 0 replies; 3+ messages in thread
From: Deric Bytes @ 2016-01-30 19:00 UTC (permalink / raw)
  To: help-gnu-emacs

Thanks @Teemu

I have found a hack. The quoted-inserts I am searching for are inside quotes.
so I can use a character class

(re-search-forward "\"[[:cntrl:]]\"")


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-01-30 19:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-30 18:11 How to search for any quoted-insert ctrl character Deric Bytes
2016-01-30 18:35 ` Teemu Likonen
2016-01-30 19:00 ` Deric Bytes

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.