Regular Expression test
- Author
- Message
-
Offline
- Site Admin
- Posts: 6311
- Joined: Thu Jul 06, 2006 7:20 am
Regular Expression test
Test version of AkelPad.
Now all quantifiers are greedy (except for single dot, like, ".*" or ".{5,10}"). To make it non-greedy (old behaviour) use "?" after quantifier, like, "\d*?".
Now all quantifiers are greedy (except for single dot, like, ".*" or ".{5,10}"). To make it non-greedy (old behaviour) use "?" after quantifier, like, "\d*?".
-
Offline
- Site Admin
- Posts: 6311
- Joined: Thu Jul 06, 2006 7:20 am
Test version
Now single dot, like, ".*" or ".{5,10}" is also greedy. AkelPad regular expressions greediness works is in the following way:
- Pattern "a.*b" in "aabbccaabbcc" matches "aabb" (not "aabbccaabb")
- Pattern "a.*?b" in "aabbccaabbcc" matches "aab"
Now single dot, like, ".*" or ".{5,10}" is also greedy. AkelPad regular expressions greediness works is in the following way:
- Pattern "a.*b" in "aabbccaabbcc" matches "aabb" (not "aabbccaabb")
- Pattern "a.*?b" in "aabbccaabbcc" matches "aab"
-
Offline
- Site Admin
- Posts: 6311
- Joined: Thu Jul 06, 2006 7:20 am
Test version
Returned back to the first variant (single dot, like, ".*" or ".{5,10}" is non-greedy). Second acquired unneeded slowdown.
AkelPad regular expressions greediness works consequentially:
- Pattern "ab?b" in "abc" has no matches, because "ab?" matches "ab" and next "b" has no match. Correct pattern will be "abb?".
Returned back to the first variant (single dot, like, ".*" or ".{5,10}" is non-greedy). Second acquired unneeded slowdown.
AkelPad regular expressions greediness works consequentially:
- Pattern "ab?b" in "abc" has no matches, because "ab?" matches "ab" and next "b" has no match. Correct pattern will be "abb?".
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
In test version, backward search (Shift+F3) does not work properly.
What: \w+
Text:
What: \w+
Text:
Code: Select all
a, bc, def
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
Instructor
AkelPad ver. 4.9.8 dev (2016-05-17), "Find" dialog.
What:Direction: "Down" or "Up".
If caret is at end of document, AkelPad crashes.
AkelPad ver. 4.9.8 dev (2016-05-17), "Find" dialog.
What:
Code: Select all
(?s)^.+?$
If caret is at end of document, AkelPad crashes.