On 8/11/06, Nick Treleaven nick.treleaven@btinternet.com wrote:
On 10/08/06 17:40:27, John Gabriele wrote:
On 8/9/06, Enrico Tröger enrico.troeger@uvena.de wrote:
Changes since Geany 0.7: [snip]
- Added support for back references when using regex replace.
Nice. :) But, I think I found a problem with it. Try putting this into your file:
LiquidCooled WaterCooled
Then try the following Search/Replace: search text: [A-Z]([a-z]+)Cooled replace text: XXX\1Cooled
It works the first time through, but then if you make the search loop around, the 2nd time it finds too much (all three of the X's instead of just the first one), and the replacement gives you a strange number of X's...
I think you don't have case sensitive checked ;-) So [A-Z] is the same as [a-z]. It works if you use case sensitive regexes.
Gah! Ouch. Missed that. Thanks.
Incidentally, in a previous thread (http://lists.uvena.de/pipermail/geany/2006-August/000358.html) I requested that, when the user clicks that "Use regular expressions"checkbox, that it might be a good idea to automatically select the "Case sensitive" option too, since users will be expecting that regexes start off case-sensitive by default. Nick, you mentioned you didn't think it's necessary, but I think it's kinda' funny that I was caught by it myself (embarrassingly, after previously bringing it up!). I will now train myself to always check that option whenever I select the regex option (since almost all of my regex searches are case sensitive), but if you think that the majority of your users will also have to train themselves like that, you might reconsider setting the option automatically. Principle of least surprise and all. :)
Thanks again! ---John