Bug 315770 - Kate search and replace plugin regular expressions are not greedy
Summary: Kate search and replace plugin regular expressions are not greedy
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-25 21:17 UTC by Todd
Modified: 2013-02-26 17:08 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 4.11


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Todd 2013-02-25 21:17:44 UTC
The kate search and replace plugin supports regular expressions.  However, unlike the regular expression system in the normal kate find/replace tool, and unlike most other regular expression implementations, the one in the search and replace tool is not "greedy", that is it finds the smallest possible match rather than the largest.

Reproducible: Always

Steps to Reproduce:
1. Open a new kate document
2. In the document, type this "111111" (no quotes)
3. Open the search and replace plugin.
4. In the plugin, type this "[1]+" (no quotes)
5. Check the "Regular Expressions" checkbox
6. Press "search"
Actual Results:  
You get 6 matches, each with one character

Expected Results:  
You get 1 match, "11111".  

The normal find/replace tool has 1 match, "11111".  In other words, the normal find/replace tool behavior is the same as the expected behavior for the search and replace plugin.
Comment 1 Kåre Särs 2013-02-26 17:08:03 UTC
Git commit 3923865136abf75ddfb1ca2e1170e33d32316383 by Kåre Särs.
Committed on 26/02/2013 at 16:41.
Pushed by sars into branch 'master'.

S&R: Start searching for the next match after the end of the previous match
FIXED-IN: 4.11

M  +1    -1    kate/plugins/search/search_folder.cpp
M  +1    -1    kate/plugins/search/search_open_files.cpp
M  +1    -1    kate/plugins/search/search_project.cpp
M  +1    -1    kate/plugins/search/search_while_typing.cpp

http://commits.kde.org/kate/3923865136abf75ddfb1ca2e1170e33d32316383