[prev in list] [next in list] [prev in thread] [next in thread] 

List:       nedit-develop
Subject:    [ nedit-Bugs-2642160 ] "[char]*$" S&R regexp doing double-pass?
From:       "SourceForge.net" <noreply () sourceforge ! net>
Date:       2009-02-26 15:37:02
Message-ID: E1LciII-0006jU-P1 () 565xhf1 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Bugs item #2642160, was opened at 2009-02-26 15:34
Message generated for change (Comment added) made by nobody
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=111005&aid=2642160&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: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: "[char]*$" S&R regexp doing double-pass?

Initial Comment:
Hi,
I'm not sure whether this is a bug or feature.
I first noticed it when using the regexp "\s*$" in the "Find" section
of the "Find and Replace" dialog, and doing a (regexp) replace for
some character, for example ";", I see ";" inserted twice if there are
one or more space characters at the end of the line, instead of just
once (as is the case if there are no spaces).

So if for example I started with:
1
2<space>
3<space><space>
4<space><space><space>

And did the above search/replace, I end up with:
1;
2;;
3;;
4;;

To debug, I tried starting with:
0
1a
2aa
3aaa
4aaaa

And doing S&R for "a*$" to ";". The way I read this is "replace zero
or more instances of the character "a" at the end of the line with
";".
Trying "perl -ne's/a*$/;/;print;' file" with "file" having the above
content gave as expected a single ";" at the end of each line.
However with NEdit S&R, I saw the same behavior as "\s*", namely 2 ";"
if "a" appeared one or more times in the line.

Note BTW that regexp with start-of-line anchor ("^a*" for example) did
not have any such problems.

Best regards,
--
Offer Kaye

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2009-02-26 15:37

Message:
See also email thread started at:
http://www.nedit.org/pipermail/discuss/2009-February/009991.html

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=111005&aid=2642160&group_id=11005
-- 
NEdit Develop mailing list - Develop@nedit.org
http://www.nedit.org/mailman/listinfo/develop
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic