AkelPad Forum Index AkelPad
Support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

EOL Regular expression and crash.

 
Post new topic   Reply to topic    AkelPad Forum Index -> Discussion (English)
View previous topic :: View next topic  
Author Message
tempamir



Joined: 25 May 2012
Posts: 2

PostPosted: Fri May 25, 2012 10:37 am    Post subject: EOL Regular expression and crash. Reply with quote

If I have text file open with:

Quote:
a

b

c


And I use Edit>Replace:
Quote:
What:$+
With:

Then Akelpad crashes.

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

D
;Earth;Mars

E
;Saturn

F
;Jupiter;Venus

Into this:
Quote:
Test;Earth;Mars;Saturn;Jupiter;Venus
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 5163

PostPosted: Fri May 25, 2012 3:11 pm    Post subject: Re: EOL Regular expression and crash. Reply with quote

tempamir wrote:
Then Akelpad crashes.
Test version

Quote:
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
Back to top
View user's profile Send private message Send e-mail
tempamir



Joined: 25 May 2012
Posts: 2

PostPosted: Fri May 25, 2012 8:00 pm    Post subject: Re: EOL Regular expression and crash. Reply with quote

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:
Quote:
TestD ;Earth;MarsE ;SaturnF ;Jupiter;Venus


I need it to return:
Quote:
Test;Earth;Mars;Saturn;Jupiter;Venus


This seems to work:
Quote:
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]
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AkelPad Forum Index -> Discussion (English) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


SourceForge.net Logo Powered by phpBB © 2001, 2005 phpBB Group