Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Regexp find & replace & replace all implementation #202
Conversation
added some commits
Nov 20, 2016
|
Please review and merge it. |
|
@raveit65 @XRevan86 @lukefromdc @sc0w |
|
As we are a small team it is helpful to provide simple steps to test. |
|
@raveit65 @XRevan86 @lukefromdc @sc0w |
|
I found a nasty bug, when using "test" and "grtry" as test lines. A search on "t." worked, selecting everything after the "t" but a seach on "t" caused a segfault:
|
|
@lukefromdc |
|
@lukefromdc |
|
This has a lot of problems, (and no recent change in behavior-still segfaults). OK, I used a test file (one I cannot publish) with a lot of numbers in them today. Will use no quotes in the search terms below for clarity: *A search for 105 finds instances of 105 throughout the file, with or without "match regular expression" checked. This is as expected. A search for 105 I would expect to find lines beginning with 105 and those portions of lines after occurances of 105-but instead if finds all instances of 10 and does NOT select anything after the occurrance of 10 in that line. Clearly * is causing the last character of the search term to be cut off the string. A search for 105.* returns all lines beginning with 105 and those portions of lines after occurances of 105 This, however, is what I would have expected from 105* and not 105.* Apparently the pair of characters .* is now doing what I would expect * to do by itself. Finally, a search for 5.* returns everything after an instance of 5 in a line, and a search for 5* closes Pluma with a segfault, apparently from trying to search for a string of zero length. This makes sense, as adding the * glob is causing the last character of the string to be cut off from the search term. When there is only one character in the search string, cutting it off reduces the length of the string to zero and thus the segfault. Looks like there is a string handling issue here, possibly with handling the EOF |
|
This is correct behaviour ( see https://developer.gnome.org/glib/stable/glib-regex-syntax.html ) |
|
@lukefromdc |
|
I am only familiar with wildcard use, this is not something I've ever used so no I didn't see the expected behavior was different. Didn't expect the segfaults or the cut off characters though so at least I found something useful with these tests. |
added some commits
Jan 8, 2017
|
@lukefromdc |
|
I don't have merge authority for Pluma but will test this |
|
@lukefromdc |
|
Segfaults are gone, though 150* still matches 15 , not sure if that is the intended behavior or not. I really don't have the experience using regular expressions to know what is correct. |
epgfm
commented
Jan 10, 2017
•
|
I believe it is correct, the expression would parse to "15" followed by zero or more "0" |
|
Than this should be good to go, though I do not have merge authority on Pluma |
|
@raveit65 |
raveit65
merged commit a79faa6
into
mate-desktop:master
Jan 10, 2017
|
Thank you and thanks to @lukefromdc for the review. |
barkovv commentedNov 20, 2016
Resolves #89
It handles case and wrap search correctly. I guess this feature is usefull since support for python plugins was dropped.