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

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

Re: test for shy-group "feature"?


From: David Kastrup
Subject: Re: test for shy-group "feature"?
Date: Sat, 10 Dec 2005 02:45:37 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

"Drew Adams" <drew.adams@oracle.com> writes:

> Emacs 22 has shy groups for regexps; previous versions did not.

Wrong.

* Lisp changes in Emacs 21.1 (see following page for display-related features)

[...]

** Regular expressions now support intervals \{n,m\} as well as
Perl's shy-groups \(?:...\) and non-greedy *? +? and ?? operators.
Also back-references like \2 are now considered as an error if the
corresponding subgroup does not exist (or is not closed yet).
Previously it would have been silently turned into `2' (ignoring the `\').

> When writing conditional code that tries to work with multiple Emacs
> versions, it is usually better to test fboundp, boundp, or featurep, than it
> is to test the major version. I couldn't find any function, variable, or
> feature associated with this new "feature", shy groups. Is there one that I
> might have missed? Thanks.

(if (string-match "\\(?:\\)" "")
   ...
 ...)

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum


reply via email to

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