all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Yuri Khan <yuri.v.khan@gmail.com>, help-gnu-emacs@gnu.org
Subject: RE: Regexp: match any character including newline
Date: Wed, 16 Oct 2013 09:53:52 -0700 (PDT)	[thread overview]
Message-ID: <a85aacea-bb0a-4dd0-98b2-b75cf82cfe2a@default> (raw)
In-Reply-To: <CAP_d_8Vj6Wa6OXP_73jxaZOM3U6cw8sc2zHkae5gfgVR6to2mg@mail.gmail.com>

> “.” needs to match any character including newline.
> I know the obvious solution: instead of “.”, use the following
> monstrosity:
>
> \(?:.\|
> \)
> 
> However, I find that very cumbersome to type, especially since I
> have to press C-q C-j in between.
> 
> Is there a way to make “.” match newline too, or is there an easier
> way to match any character including newline?

1. I and others have requested this for vanilla Emacs a few times,
as a user toggle.  E.g.:

* http://lists.gnu.org/archive/html/emacs-devel/2006-03/msg00162.html
* http://lists.gnu.org/archive/html/emacs-devel/2006-03/msg00476.html
* http://lists.gnu.org/archive/html/emacs-devel/2006-11/msg01559.html
* http://lists.gnu.org/archive/html/emacs-devel/2006-12/msg00115.html

2. In Icicles at least, you can use `C-M-.' to toggle what `.'
represents in the minibuffer (i.e., for most interactive use).  When
`.' matches also a newline, it appears as `.' in the minibuffer, but
the actual regexp used under the covers is "\(.\|[
]\)".  (When this is the case, it is also highlighted, so you can tell.)

IOW, when newline is also being matched by `.', this propertized string
is inserted in the minibuffer when you type `.':

#("\\(.\\|[
]\\)" 0 10 (face highlight display "."))

Not the ideal solution (hence the requests cited), but handy enough.



  parent reply	other threads:[~2013-10-16 16:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-16 14:42 Regexp: match any character including newline Yuri Khan
2013-10-16 15:31 ` Kai Großjohann
2013-10-16 15:56   ` Yuri Khan
2013-10-16 16:53 ` Drew Adams [this message]
2013-10-17  2:25 ` Eric Abrahamsen
     [not found] <mailman.4131.1381934579.10748.help-gnu-emacs@gnu.org>
2013-10-16 15:58 ` Rustom Mody
2013-10-16 16:16   ` Yuri Khan
     [not found]   ` <mailman.4141.1381940186.10748.help-gnu-emacs@gnu.org>
2013-10-16 16:48     ` Rustom Mody

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a85aacea-bb0a-4dd0-98b2-b75cf82cfe2a@default \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=yuri.v.khan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.