[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: using non-Emacs regexp syntax
From: |
Paul Pogonyshev |
Subject: |
Re: using non-Emacs regexp syntax |
Date: |
Wed, 29 Nov 2006 21:13:19 +0200 |
User-agent: |
KMail/1.7.2 |
David Kastrup wrote:
> "Drew Adams" <address@hidden> writes:
>
> >> Is there a function to convert non-Emacs regexps (e.g. "ab(c+|d)" to
> >> Emacs regexps (example to "ab\(c+\|d\)")?
> >>
> >> The first form appears to be an "extended regexp" or egrep-style regexp.
> >> The second appears to be a "basic regexp" or grep-style regexp.
> >>
> >> This conversion feature in Lisp would be useful to add after the release.
> >
> > Very glad to hear that.
> >
> > I'm hoping there will also be support for toggling the newline sensitivity
> > of dot. This means a "doc-matches-newline" mode (aka "single-line" mode)
> > where `.' will also match newline. Please see the thread "short regexp to
> > match any character?" from 2006/03/04 and 03/11.
>
> I don't know any other matcher where dot matches a newline. Quite
> more relevant would be inverse character ranges like [^A-Z] that do
> _not_ match newline by default.
As far as I remember, Perl regexp syntax has a flag to match or not match
newline by default. Emacs could adopt a similar flag facility, or use native
flag variables (like `case-fold-search', just with a different meaning.)
Paul
Re: using non-Emacs regexp syntax, Paul Pogonyshev, 2006/11/29