EOL Regular expression and crash.

English main discussion
Post Reply
  • Author
  • Message
Offline
Posts: 2
Joined: Fri May 25, 2012 10:21 am

EOL Regular expression and crash.

Post 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

Offline
Site Admin
Posts: 6311
Joined: Thu Jul 06, 2006 7:20 am

Re: EOL Regular expression and crash.

Post 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

Offline
Posts: 2
Joined: Fri May 25, 2012 10:21 am

Re: EOL Regular expression and crash.

Post 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]
Post Reply