#1
|
||||
|
||||
Question: Using RegEx in Search Bar
From this very old post https://board.jdownloader.org/showpo...78&postcount=4 I learned that there is a setting to enable RegEx in Advanced Settings.
Cannot find such a setting when searching for RegEx. Is there some kind of auto-detect now? |
#2
|
||||
|
||||
in advanced settings > use the filter regex, would end up with 4 results of which the first is your required value, GeneralSettings.filterregex
__________________
raztoki @ jDownloader reporter/developer http://svn.jdownloader.org/users/170 Don't fight the system, use it to your advantage. :] |
#3
|
||||
|
||||
@StefanM: also see https://board.jdownloader.org/showpo...28&postcount=2
__________________
JD-Dev & Server-Admin |
#4
|
||||
|
||||
Quote:
Quote:
Thanks to both of you! And another question for you: Before I write another request... I guess that there must be a reason, why wildcards,... are not supported? If e.g. I want to see videos only, I cannot use Code:
*.mp4|*.avi|*. .... |
#5
|
||||
|
||||
@StefanM: because that is no valid regex.
Either you use valid regex or use simple mode but without regex support
__________________
JD-Dev & Server-Admin |
#6
|
||||
|
||||
They are!
no regex Quote:
Quote:
__________________
JD-Dev & Server-Admin |
#7
|
||||
|
||||
for example, regex
Quote:
__________________
JD-Dev & Server-Admin Last edited by Jiaz; 05.06.2022 at 12:07. |
#8
|
||||
|
||||
Quote:
In JD I have RegEx not enabled. Just tested this morning: Code:
*.txt However, Code:
.txt So, my conclusion is the same as in my old documentation: "Wildcards don't work here" |
#9
|
||||
|
||||
@StefanM: Just tested and wildcard works perfectly fine.
Settings->Advanced Settings->GeneralSettings.filterregex disable I enter Quote:
__________________
JD-Dev & Server-Admin |
#10
|
||||
|
||||
@StefanM: I've tested bottom Searchfield in Downloads/Linkgrabber with and without regex mode, both working perfectly fine
regex disabled: Quote:
regex enabled: Quote:
regex enabled: Quote:
__________________
JD-Dev & Server-Admin |
#11
|
||||
|
||||
Code:
\.(avi|mp4|mkv)$ What I did not know was, that you can leave the configuration in advanced settings for filterregex disabled and that instead you can type regex: in the search pane to enable it just for one search. However, can you please tell me which of these delimiters is being accepted by JD? Couldn't find it in my documentation Must have forgotten to write it down... Code:
/ ~ @ ; % `# |
#12
|
||||
|
||||
I'm sorry but what do you mean? It's normal java Regex/Pattern.
__________________
JD-Dev & Server-Admin |
#13
|
||||
|
||||
@StefanM: In NON Regex mode, there are no delimiters! * is replaced internally by
Quote:
Quote:
But if required, I can add Quote:
__________________
JD-Dev & Server-Admin |
#14
|
||||
|
||||
Quote:
It is not working for me. And I tested more than just one installation :( Or am I making a mistake here? Found the bug! Those two files contain the string .avi somewhere in the middle of the file name. However, the file name ends with .mp4 *.avi must never match a file that ends with .mp4. Only *.avi* is matching file names where you find .avi somewhere in the middle of that name. So, it is not working correctly! Last edited by StefanM; 05.06.2022 at 15:06. Reason: Addendum |
#15
|
||||
|
||||
@StefanM: screenshot doesn't show the full filename
tested and working fine here Quote:
Quote:
__________________
JD-Dev & Server-Admin Last edited by Jiaz; 05.06.2022 at 15:08. |
#16
|
||||
|
||||
Just a moment....
|
#17
|
||||
|
||||
Too bad, that you don't believe me...
But here's the proof you requested. As I said: *.avi also returns files with .avi somewhere in the middle of the name. Please test yourself! You can simply rename any files you have in JD to verify my findings. Last edited by StefanM; 05.06.2022 at 15:16. |
#18
|
||||
|
||||
That's not what I told you. But I've just tested with Downloads/Linkgrabber multiple times and cannot reproduce any issues. Also there has been no changes since ages on this.
__________________
JD-Dev & Server-Admin |
#19
|
||||
|
||||
Quote:
https://board.jdownloader.org/showpo...7&postcount=15 That is expected behaviour. The simple NON regex mode is SIMPLE. It just tries to find your input and in your case the filename contains Quote:
Quote:
__________________
JD-Dev & Server-Admin |
#20
|
||||
|
||||
Quote:
We have a bug here. When JD accepts wildcards correctly, then e.g. *.txt may only return files that end with .txt. A file such as test.txt.doc may not be returned. That's the wildcard definition. But JD also returns test.txt.doc when searching for *.txt And that is not correct! I learned this wildcard definition more than 40 years ago It is still valid - also in the console (CMD). Last edited by StefanM; 05.06.2022 at 15:27. |
#21
|
||||
|
||||
Quote:
and make it default for new installations but not for existing ones
__________________
JD-Dev & Server-Admin |
#22
|
||||
|
||||
I don't agree but I will change behaviour and we will see how many ppl will complain about it and then add optional *old mode* back
__________________
JD-Dev & Server-Admin |
#23
|
||||
|
||||
Quote:
Still prepared to learn new things And of course I do not know your URS, how it was specified in the first place... But I'm convinced that anybody familiar with using wildcards will not complain when you change it. Just look at any program supporting wildcard searches. All programs I know, work the way I described it. And people using wildcards for searching will be used to that way. Last edited by StefanM; 05.06.2022 at 15:40. |
#24
|
||||
|
||||
@StefanM: it's just the way we implemented it. You are right about the *how a wildcard* should work and I don't disagree with that. I'm just saying that changing how things worked since ages can easily break stuff when ppl rely on *how it used to work*.
Just testing my changes and next core update will be available shortly.
__________________
JD-Dev & Server-Admin |
#25
|
||||
|
||||
@StefanM: Please check if it works like expected with next core update. update will be available within next 5 mins
__________________
JD-Dev & Server-Admin |
#26
|
||||
|
||||
@StefanM: some personal words .... I DO agree with you on this one! (how wildcards should work) but forgive me for my words...I sometimes really have to struggle to understand/find out what you're really trying to say!
For example, https://board.jdownloader.org/showpo...93&postcount=4 Here you just wrote wildcards don't work but actually you wanted to say that the result of this search is not what you've expected, due to different expectationshow wildcards should work. In the end I do agree with you but I really find it stressful to come to the point where both parties finally *talk* about the same topic/issue.
__________________
JD-Dev & Server-Admin |
#27
|
||||
|
||||
Quote:
I'd really like to answer your question, so you better understand. |
#28
|
||||
|
||||
@StefanM: Yes, there is a reason I've disabled PMs It's okay to write here on board and you can also contact me via jiaz@jdownloader.org
I just wanted to explain that it's stressful to have long conversation just to reach a point where finally both parties speak of the same in this case a simple *I think wildcard works differently than I expect* would be better than *wildcards don't work* The core update is available, please test and provide feedback if it now works like expected
__________________
JD-Dev & Server-Admin |
#29
|
||||
|
||||
Quote:
Yes, it works a expected and I assume it'll work for package names, etc. the same way? Will send you an email within the next minutes. |
#30
|
||||
|
||||
It's the same method for searchbar and packagizer/filter/view rules, hence my fear that it may easily break user configuration
__________________
JD-Dev & Server-Admin |
#31
|
||||
|
||||
Quote:
Because those who would have tried to use wildcards, would have encountered the same problems I encountered and then (as I did it) gave up trying to use wildcards and instead used RegEx. PS: Sent you an email. And maybe you should edit your post with you mail address, so that your mailbox won't get flooded with unwanted mails or even spam, once bots have found it. What I didn't know or forgot, how to use/enable RegEx in the search bar. And I only found out about '|' as separator (in non-RegEx mode) because this is also being used in grepWin. In many programs I know ';' is used as separator in non-RegEx mode. PS note: Don't want to nag you, but if there were a changelog, users would know, why their filter using wildcards would not work any longer But I'm curious, if there will be any complaints at all. And then you know how many users used the non-RegEx mode. Last edited by StefanM; 05.06.2022 at 17:22. |
#32
|
||||
|
||||
Before I write too much, the screenshot will explain my question
|
#33
|
||||
|
||||
You've got to switch to Java. PHP Syntax is different than Java
__________________
JD-Dev & Server-Admin |
#34
|
||||
|
||||
My e-mail is nothing to hide You can find it several times on this board. I will read/response asap
__________________
JD-Dev & Server-Admin |
#35
|
||||
|
||||
Now...
... I don't understand :( I can work with RegEx, even though I'm far from being a RegEx expert. In different applications, I have to use different delimiters: e.g. SpeedCommander uses another delimiter than EPF does. Both are Windows programs and I enter my RegEx's in their GUIs. I consider JD's GUI also a Windows GUI. But of course I see the differences, e.g. when browsing for a directory. But if there are additional differences because J(ava)Downloader is programmed in Java, I'm afraid I don't understand. And when it comes to Java, I simply have no experience at all. That's probably why I don't understand what you want to tell me. |
#36
|
||||
|
||||
@StefanM: in regex101,on the left side, you have to choose Java mode! Syntax is different than for example PHP mode.
You have to escape "quotation mark" and "backslash" and metacharacters, for example see baeldung.com/java-regexp-escape-char docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html en.wikipedia.org/wiki/Regular_expression#Delimiters
__________________
JD-Dev & Server-Admin Last edited by Jiaz; 05.06.2022 at 19:11. |
#37
|
||||
|
||||
Quote:
Even though I already managed to create working RegEx's in JD's filters in the past |
#38
|
||||
|
||||
__________________
JD-Dev & Server-Admin |
#39
|
||||
|
||||
@StefanM: first breaking of existing rules, https://board.jdownloader.org/showthread.php?t=90856
__________________
JD-Dev & Server-Admin |
#40
|
||||
|
||||
Quote:
Now let's see how many users will complain... I would say not more than 5. What is your guess? |
Thread Tools | |
Display Modes | |
|
|