Bug 108136

Summary: incorrect highlighting if expression ends with "$" character
Product: [Applications] kregexpeditor Reporter: Tim Weber <kde.bugs>
Component: generalAssignee: Jesper Pedersen <blackie>
Status: CONFIRMED ---    
Severity: normal CC: kyron
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Tim Weber 2005-06-26 00:27:29 UTC
Version:            (using KDE KDE 3.4.1)
Installed from:    Gentoo Packages
Compiler:          gcc version 3.3.5-20050130 (Gentoo 3.3.5.20050130-r1, ssp-3.3.5.20050130-1, pie-8.7.7.1)
OS:                Linux (i686) release 2.6.11-gentoo-r9

There seems to be some strange behaviour when using a regular expression ending with (maybe as well containing a) the "$" character, indicating line end.

For example, with the expression "...$" and the test string "abcde", only "de" gets highlighted. Using the expression "cde$" and the same test string, nothing matches.

This is, as far as I can see, no bug in the regex engine itself, since for example replacing in KWrite with such an expression works without any problem.
Comment 1 Carsten Niehaus 2005-07-02 18:25:15 UTC
I can confirm this.

The regexp ffff$ does not match the string "ffff".
Comment 2 Bram Schoenmakers 2005-08-13 12:57:58 UTC
A very strange bug.

regexp.search( text ) inside KRegExpEditor gives another result than regexp.search( text ) inside a test program. Same regexp, same text, but different results.
Comment 3 Oscar Curero 2006-03-26 17:16:50 UTC
Is this bug present in kde 3.5.1?
I'm using kde 3.5.0 and kregexpeditor shows wrong hightlighting when "end of line" ($) is used.  
Comment 4 Tim Weber 2006-03-26 18:13:47 UTC
Yes, it's still happening on my KDE 3.5.1 (Gentoo).
Comment 5 Bram Schoenmakers 2006-09-24 10:42:14 UTC
Looked again at it and it's a bug in Qt3. I cannot verify yet whether this is still the case with the Qt4 series.
Comment 6 Eric Thibodeau 2006-11-09 16:14:13 UTC
Well, also the case with 3.5.4, but that one is still compiled with Qt3...so, waiting for Qt4 version.
Comment 7 Keith Paulson 2007-06-22 01:52:15 UTC
Oddly, while 'abc$' matches neither 'abc' or 'xxabc', 'abc<space>$' *does* match both, but does not match 'abc<space>'.  Could it be an issue parsing the regexp, and the space is serving as a terminator?