|
[User feedback required] How to name the file with only the alphanumeric characters of the url |
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How to name the file with only the alphanumeric characters of the url
So, I'm a beginner in this whole regular expression deal, but here's my problem.
I need to name my files in according to their source urls, more specifically I need to remove all non-alphanumerics characters. An example: I have this file Code:
**External links are only visible to Support Staff** Code:
httpsdrivegooglecomucexportdownloadid14YrfZFcr07ZOrBauATKS4Mg0pE66.png Looking up online sites I was able to reach at this regular expression that would match all my desired characters, "([^\W_])". Now my problem is transferring this to the file name. I was using "<jd:source:1>.<jd:orgfiletype>" but this unfortunately only gives me a "h.png". I tried looking some kind of tutorial but all I could find of <jd:source:1> was answers in the forums so I've reached a wall. Any help would be appreciated, thank you very much! |
#2
|
||||
|
||||
your first regex condition only repeats for single character hence why just h is returned, use + as repeat. not sure you can achieve your desired outcome to be honest, since you don't exactly know how many times its going to repeat. For instance how many / and ? (illegal chars). Since you need to do jd:source:x for each repeat. either you need to create many rules to cover said repeats, or it might be easier to achieve with eventscripter (javascript) extension module.
__________________
raztoki @ jDownloader reporter/developer http://svn.jdownloader.org/users/170 Don't fight the system, use it to your advantage. :] Last edited by pspzockerscene; 14.04.2020 at 13:31. Reason: Hyperlinked EventScripter |
|
|