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: Drew Adams
Subject: RE: test for shy-group "feature"?
Date: Fri, 9 Dec 2005 19:42:18 -0800

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

    Wrong.

    ** 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 `\').

I didn't find any reference to "shy" by grepping the source code. Thanks for
looking in News.

    > 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 "\\(?:\\)" "")
       ...
     ...)

Very good (elegant - it even acts as an explanatory comment).

Thanks.






reply via email to

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