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 

Bug reports
Goto page Previous  1, 2, 3 ... 9, 10, 11, 12  Next
 
Post new topic   Reply to topic    AkelPad Forum Index -> Discussion (English)
View previous topic :: View next topic  
Author Message
KDJ



Joined: 06 Mar 2010
Posts: 1325
Location: Poland

PostPosted: Thu Mar 07, 2013 12:07 pm    Post subject: Reply with quote

Thanks Instructor.
Now, "\0" generates a syntax error, so it's OK.
Back to top
View user's profile Send private message
KDJ



Joined: 06 Mar 2010
Posts: 1325
Location: Poland

PostPosted: Fri Mar 08, 2013 1:36 pm    Post subject: Reply with quote

Instructor
\Z
- it seems to me that it works well.

There is a problem with \A anchor:
\A
- matches to the border between any characters and to the end of the text:
\A.
- matches any single character.

In the new test version does not have changes that you have entered yesterday ("\0", "\0+", "\0*", "\0{2,}"): http://akelpad.sourceforge.net/forum/viewtopic.php?p=21420&highlight=#21420
Back to top
View user's profile Send private message
KDJ



Joined: 06 Mar 2010
Posts: 1325
Location: Poland

PostPosted: Fri Mar 08, 2013 3:23 pm    Post subject: Reply with quote

I found still these bugs:
\Z - also matches "Z" character,
.\A - also matches any character plus "A" (eg: "BA", "CA").
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 5293

PostPosted: Sat Mar 09, 2013 6:40 am    Post subject: Reply with quote

KDJ
KDJ wrote:

There is a problem with \A anchor:
\A
- matches to the border between any characters and to the end of the text:
\A.
- matches any single character.
It is so, if you press "Find next". Because:
AkelHelp-Eng.htm wrote:
\A Matches the position at the beginning of the search range.
\Z Matches the position at the end of the search range.

Quote:
In the new test version does not have changes that you have entered yesterday ...
Already merged.

Quote:
I found still these bugs...
Test version
Back to top
View user's profile Send private message Send e-mail
KDJ



Joined: 06 Mar 2010
Posts: 1325
Location: Poland

PostPosted: Sat Mar 09, 2013 1:44 pm    Post subject: Reply with quote

Instructor
Thank you very much, now everything is OK.

In AkelHelp-Eng.htm:
- description of expression "(?<!pattern)" is truncated,
- You can add that "\z" is equivalent "\Z".
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 5293

PostPosted: Sun Mar 10, 2013 9:48 am    Post subject: Reply with quote

KDJ wrote:
description of expression "(?<!pattern)" is truncated
Corrected.
Back to top
View user's profile Send private message Send e-mail
KDJ



Joined: 06 Mar 2010
Posts: 1325
Location: Poland

PostPosted: Sun Mar 10, 2013 12:26 pm    Post subject: Reply with quote

The following two regular expressions work in different ways:
\w+(\W*)
\w+\W*
In the first regexp, the "+" quantifier is lazy (non-greedy).
In the second, the "+" quantifier is greedy.

However, you may need to implement two types of quantifiers:
- greedy: ?, *, +, {n1,n2}
- lazy: ??, *?, +?, {n1,n2}?


Instructor wrote:
\A Matches the position at the beginning of the search range.
\Z Matches the position at the end of the search range.

Can you still add:
\a - matches the position at the beginning of the string.
\z - matches the position at the end of the string.
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 5293

PostPosted: Fri Mar 15, 2013 8:29 am    Post subject: Reply with quote

KDJ wrote:
The following two regular expressions work in different ways...
Test version

KDJ wrote:
Can you still add:
\a - matches the position at the beginning of the string.
\z - matches the position at the end of the string.
Don't understand the request. Can you explain with examples?
Back to top
View user's profile Send private message Send e-mail
KDJ



Joined: 06 Mar 2010
Posts: 1325
Location: Poland

PostPosted: Fri Mar 15, 2013 8:00 pm    Post subject: Reply with quote

Instructor
I need to replace the first and last character in the text on "x".
Text:
Code:
bbbb
bbbb

What: \A.|.\Z
With: x

Result (Replace all):
Code:
xxxxxxxxx

It was to be:
Code:
xbbb
bbbx

Such anchors are needed to indicate the beginning and end of the text, no the beginning/end of the search range.

And one more thing. These expressions work in different ways:
(\Ab)|(b\Z)
\Ab|b\Z
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 5293

PostPosted: Sat Mar 16, 2013 10:09 am    Post subject: Reply with quote

KDJ wrote:
What: \A.|.\Z
Quote:
These expressions work in different ways...

Test version
Back to top
View user's profile Send private message Send e-mail
KDJ



Joined: 06 Mar 2010
Posts: 1325
Location: Poland

PostPosted: Sat Mar 16, 2013 1:25 pm    Post subject: Reply with quote

Instructor
If:
\A - matches the position at the beginning of the search range,
\Z - matches the position at the end of the search range,
in the previous test version it worked well.

In the new test version it is inconsistent.
In the above example, regexp matches 9 times (8 times "b" and 1 time new line), and replaces only 2 times.

I propose to add two new anchors \a, \z (or change the way of working \A, \Z), so that:
\a - matches the position at the start of the text,
\z - matches the position at the end of the text.
"\a" should match only the beginning of the text (only once), like "^" matches only the beginning of the line (only once, if there is one line).

It seems to me that this is a well done in SynWrite: http://www.uvviewsoft.com/synwrite/
Back to top
View user's profile Send private message
cnnnc



Joined: 12 Jan 2008
Posts: 116
Location: Shantou, China

PostPosted: Mon Mar 18, 2013 2:43 am    Post subject: Reply with quote

Code:
123   abc   abc   abc   abc
456   def   def   def
789   ghi   ghi
Ctrl+F
Code:
(\w+)\t(\w+)(\t\2)+
[v]Regular Expression
(*)Beginning
It's can't find any. But SearchReplace.js can.
I have to try
Code:
(\w+)\t(\w\w\w)(\t\2)+
--------------------
WinXP SP3 ChineseSimplified With most safe hotfix
AkelPad 4.8.1+
Back to top
View user's profile Send private message Send e-mail
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 5293

PostPosted: Thu Mar 21, 2013 5:47 am    Post subject: Reply with quote

KDJ
AkelHelp-Eng.htm wrote:
\A Matches the position at the beginning of the document...
\Z Matches the position at the end of the document...
\a Same as \A, but matches the position at the beginning of the search range.
\z Same as \Z, but matches the position at the end of the search range.

cnnnc
Quote:
(\w+)\t(\w+)(\t\2)+

Test version
Back to top
View user's profile Send private message Send e-mail
cnnnc



Joined: 12 Jan 2008
Posts: 116
Location: Shantou, China

PostPosted: Thu Mar 21, 2013 7:30 am    Post subject: Reply with quote

Instructor wrote:
cnnnc
Quote:
(\w+)\t(\w+)(\t\2)+

Test version

OK.
Back to top
View user's profile Send private message Send e-mail
KDJ



Joined: 06 Mar 2010
Posts: 1325
Location: Poland

PostPosted: Thu Mar 21, 2013 8:32 pm    Post subject: Reply with quote

Instructor wrote:
\A Matches the position at the beginning of the document...
\Z Matches the position at the end of the document...
\a Same as \A, but matches the position at the beginning of the search range.
\z Same as \Z, but matches the position at the end of the search range.

"Find" works well.
You need a bit to improve "Replace all".

Text (at the end is new line char):
Code:
bbb
bbb

What: \A.|.\Z
With: x

Result of Replace all:
Code:
xbb
bbb

It should be:
Code:
xbb
bbbx


What: \a.|.\z
With: x

Result of Replace all:
Code:
xbb
bbb

It should be:
Code:
xxxxxxxx
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
Goto page Previous  1, 2, 3 ... 9, 10, 11, 12  Next
Page 10 of 12

 
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