Bug 143661

Summary: ^$\n in replace (reg. exp.) does not work.
Product: [Applications] kate Reporter: thomas krause <th_k>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description thomas krause 2007-03-31 12:04:16 UTC
Version:           2.5.1 (using KDE Devel)
Installed from:    Compiled sources
OS:                Linux

^$\n in replace (reg. exp.) does not work.
Impossible to replace empty lines.
Deleting empty lines or lines like
<p></p>
is impossible
^any text$\n in search and nothing in replace does not work.

Have to take emacs for replacing with reg-expr. because
substitution of text in brackets, inserting newlines etc. doesn't work either (already in bug-report)
Comment 1 Philippe Rigault 2007-04-01 14:29:10 UTC
INVALID

The regexp '^$\n' makes no sense, it tries to match a newline _after_ the end of the line ($). The regexp for an empty line is simply '^$'.

(note: kregexpeditor rightfully complains when you try entering '^$\n': Your regular expression is invalid, due to something following a 'line end')


Cheers.
Comment 2 Sebastian Pipping 2007-04-01 15:16:17 UTC
In reply to comment #1:

I doubt this is true in all cases: When replacing "^$\n"
with "XXX" in the three-line text "one\n\nthree" with
EmEditor I get out "one\nXXXthree". This is what I
expected since afaik "$" does not eat the newline.

But since Kate doesn't support multi-line Regex yet,
anything containing "\n" will not do what you want.
Comment 3 Anders Lund 2007-04-01 20:04:54 UTC
Kate does not support finding text that spans more than one line.

We have a GSOC project for it, and some students might start work on it even 
outside GSOC.

This bug is a dub, there are dozens of reports of this problem, even though 
the situation is clearly stated in the docs and several places on internet.
Comment 4 Matthew Woehlke 2007-04-02 20:06:42 UTC

*** This bug has been marked as a duplicate of 64910 ***