View Single Post
  #6  
Old 27.07.2016, 07:27
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,659
Default

Sorry I thought you where doing manual renaming of filenames via package customiser rules, but the provided exported packagiser rules are just defaults. So maybe not? So that leaves JD plugins returning filenames... and core doing a little processing in respects to sorting ?

err i see now you mentioned context menu rename with regex.. works fine in my tests (I clicked preview button).

first example works as intended, as you've stripped all chars not in that given pattern (including spaces)
seems also that if you have - without escaping and a char after it, it will complain.. though in true sense you only need to NOT escape - char when its between grouping like a-z, 0-9, A-Z.

personally I would use two rules, along the lines of [^A-Za-z0-9\.\-]+ and replace with " "
as first can have multiple spaces generated, which then still don't match as direct filename mirrors
and second rule to remove multiple spaces for single \s+ replace with " ";

by the way we do have code in our core and plugins which can treat particular characters as wildcard. We have this because some file hosters rename chars and then mirroring can fail (rapidshare did, and also does uploaded.to). So this can be done when we know which chars are renamed by hosters... We can't account for people who upload different filenames to different hosters or even harder again is when people use multi-uploaders services which are also known to rename chars.


raztoki
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]

Last edited by raztoki; 27.07.2016 at 07:46.
Reply With Quote