Re: [Krename-users] Regular expressions
Brought to you by:
domseichter,
stonki
From: Dominik S. <dom...@we...> - 2009-06-01 11:45:05
|
Am Donnerstag, 28. Mai 2009 schrieb Baz Walter: > Dominik Seichter wrote: > > Hello, > > > > I fixed the issue with the disapearing check box in SVN. > > thanks for fixing this so quickly (and the other things). much appreciated! > > > You already found the correct documentation for the regular expressions. > > Matching a dot with \. does work for me. Please not, that you cannot > > match the dot between filename and extension, as find and replace is > > applied separately to the filename and the extension. > > If you need this, we will have to find another solution. I added now an option, so that KRename will ignore the file extension and the whole filename (i.e. filename.extension) can be matched with regular expressions. See screenshot attached for this option. Unfortunately I forgot to commit it from my netbook before doing the release - so it is not part of the 3.9.3 release contrary to what I wrote in the release notes. Sorry about that. > > i did a few experiments which i hope you will find useful. > > i created the file "foo()[]{}?+|.bar\!=,-$^.txt" which contains all the > special regexp characters, and then tried replacing them one by one. > > i could replace these characters when they were escaped: "()?+|!=,-^." > > but i couldn't replace these ones when they were escaped: "[]{}$\" Yes, this is currently a problem of krenames parser which would need mature changes to fix that. The problem is that the parser is not based on a real tokenizer (I know, this is a HORRIBLE design) and therefore replaces "[]{}$\" internally with unknown unicode values. That is why you can't match them. > > also, i found some problems with finding the dot which marks the > extension when using the regexps "\.", "^" and "$". > > here are the results i get when trying to replace them with the > character "@" in the filename "a.b.c.txt": > > "\." gives "a.b@c@txt" but should be "a@b@c.txt" > "^" gives "@a.@b.c.txt" but should be "@a.b.c.@txt" > "$" gives "a@.b.c.txt@" but should be "a.b.c@.txt@" The new setting should fix this. > > i think the filename should be split on only the *last* dot, and then > the replacement applied to both components. or, even better, provide a > checkbox to ignore the extension so that the replacement can be made in > the filename component only (and maybe this should be the default). > > (n.b. dotfiles on unix systems need special handling - they should not > split on the last dot if the only dot is the first character in the > filename - so the file ".bashrc" has no extension). > > it would be great these problems could be fixed before the next release, > but if you do not have the time available, i understand completely! > > finally - many thanks to you dominik for this great little app! > > regards > baz walter > > --------------------------------------------------------------------------- >--- Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is > a gathering of tech-side developers & brand creativity professionals. Meet > the minds behind Google Creative Lab, Visual Complexity, Processing, & > iPhoneDevCamp as they present alongside digital heavyweights like Barbarian > Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com > _______________________________________________ > Krename-users mailing list > Kre...@li... > https://lists.sourceforge.net/lists/listinfo/krename-users -- ********************************************************************** Dominik Seichter - dom...@we... KRename - http://www.krename.net - Powerful batch renamer for KDE KBarcode - http://www.kbarcode.net - Barcode and label printing PoDoFo - http://podofo.sf.net - PDF generation and parsing library SchafKopf - http://schafkopf.berlios.de - Schafkopf, a card game, for KDE Alan - http://alan.sf.net - A Turing Machine in Java ********************************************************************** |