Bugs item #1760116, was opened at 2007-07-25 09:45
Message generated for change (Comment added) made by yooden
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=111005&aid=1760116&group_id=11005
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Joerg Fischer (jf505)
Assigned to: Nobody/Anonymous (nobody)
Summary: Negated escape sequences misinterpreted in character class
Initial Comment:
The negated escape sequences \L, \S, \D, \W, ... are misinterpreted inside a
character class. That is, [\S] matches \s, but it really should match the
opposite.
(Perl does it right.)
----------------------------------------------------------------------
>Comment By: Thorsten Haude (yooden)
Date: 2007-12-27 11:10
Message:
Logged In: YES
user_id=119143
Originator: NO
Jörg's summary from an onlist discussion:
1. (?N ) grouping by default, meaning treat \n as special char by
never matching it unless \n is given explicitly. This implies
that dot, [^...], and all the escape sequences can't match \n.
2. (?n ) grouping, meaning drop NEdit's convention to treat \n
specially and do in effect a Perl-like matching of newlines. That
is, dot does not match \n, [^...] does match \n if it is not
listed, and escape sequences do what they stand for: \s, \y, \D,
\L, and \W match newlines, \S, \Y, \d, \l and \w do not.
3. For the sake of completeness, invent a (?s ) grouping named after
Perl's s(ingle line) modifier. This matches newlines like (?n )
and in addition forces dot to match \n, too.
----------------------------------------------------------------------
Comment By: Tony Balinski (ajbj)
Date: 2007-07-26 14:32
Message:
Logged In: YES
user_id=618141
Originator: NO
I have a patch for this. It adds a few more character tables so that the
negated charset's characters can be added to the []-bracketed custom
charset, as is the case for the positive charset escapes.
Since I can't attach it here directly, you can find it here:
http://ajbj.free.fr/nedit/nedit5.5dev/patches/NegatedEscapesInClassesFix.diff
Interestingly, I notice that (?n\W) does not match newlines (my patch
allows (?n[\W]) to do so, which is rather inconsistent). This is true also
for \L, \D. Also \y without (?n ) around it will match newline. I believe
these to be faults. What about you?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=111005&aid=1760116&group_id=11005
--
NEdit Develop mailing list - [email protected]
http://www.nedit.org/mailman/listinfo/develop