Page 1 of 1

EOL Regular expression and crash.

Posted: Fri May 25, 2012 10:37 am
by tempamir
If I have text file open with:
a

b

c
And I use Edit>Replace:
What:$+
With:
Then Akelpad crashes.

Also, what regular expression can I use to change this:
Test

D
;Earth;Mars

E
;Saturn

F
;Jupiter;Venus
Into this:
Test;Earth;Mars;Saturn;Jupiter;Venus

Re: EOL Regular expression and crash.

Posted: Fri May 25, 2012 3:11 pm
by Instructor
tempamir wrote:Then Akelpad crashes.
Test version
Also, what regular expression can I use to change this...
With SearchReplace.js:

What: (.*?)\n+
With: if ($1.length > 1) return $1;

[v] Regular expressions
[v] Replace with function

Re: EOL Regular expression and crash.

Posted: Fri May 25, 2012 8:00 pm
by tempamir
Instructor wrote:Test version
Thanks, that fixed it, now returns Syntax Error as it should.
Instructor wrote:With SearchReplace.js:

What: (.*?)\n+
With: if ($1.length > 1) return $1;

[v] Regular expressions
[v] Replace with function
Didn't quite work, it returned:
TestD ;Earth;MarsE ;SaturnF ;Jupiter;Venus
I need it to return:
Test;Earth;Mars;Saturn;Jupiter;Venus
This seems to work:
With SearchReplace.js:

What: \n+(.*?)\n+
With: ;

[v] Regular expressions
[v] Replace with function
Or is there a better way?

Anyway, my problems are solved, thank you for quick response.[/quote]