JDownloader Community - Appwork GmbH
 

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 17.07.2015, 21:12
djmakinera djmakinera is offline
Banned
 
Join Date: May 2010
Location: Poland
Posts: 8,444
Default Regex help

Please correct the regex - because it does not work
15.1.7 EmEditor

(.*?)(#q\d+$|$)
\1


hXXps://example.com/example/example/48143.html#60942

My mistake - small detail :]

Last edited by Lram32; 05.11.2015 at 19:48. Reason: merged posts
  #2  
Old 17.07.2015, 22:07
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 66,134
Default

(.*?)(#\d+$|$)

why you put a q there?
__________________
JD-Dev & Server-Admin
  #3  
Old 01.08.2015, 08:48
djmakinera djmakinera is offline
Banned
 
Join Date: May 2010
Location: Poland
Posts: 8,444
Default Regex should be good but not correctly shows [FILTER]

Packagename:

Code:
123_123 AND 123 AND -123_123 AND -123
Code:
-?\d+(_+d)?
JD2 show PackageName
wrong
Code:
TEST NEW3

edit:
small correction - work
Code:
^-?\d+(_+d)?$
or
^-?\d+(_\d+)?$
but how to find the name of the package - only for a specyfic host?

Last edited by djmakinera; 01.08.2015 at 08:56.
  #4  
Old 01.08.2015, 08:55
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 16,515
Default

Code:
[\d_\-]+
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
  #5  
Old 01.08.2015, 08:57
djmakinera djmakinera is offline
Banned
 
Join Date: May 2010
Location: Poland
Posts: 8,444
Default

Quote:
Originally Posted by raztoki View Post
Code:
[\d_\-]+
^[\d_\-]+$

Last edited by djmakinera; 01.08.2015 at 09:01.
  #6  
Old 01.08.2015, 09:13
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 16,515
Default

my response was made on your first post not your 5th edit.

but if you want to match the entire input you do need ^ $ references
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
  #7  
Old 12.10.2015, 12:05
djmakinera djmakinera is offline
Banned
 
Join Date: May 2010
Location: Poland
Posts: 8,444
Default

How to ignore all Unicode characters, Japanese, Chinese, Russian, Polish and all the other chars.
Can include only chars
Name package and filename and path
Code:
-  
_ 
[0-9]
& all path that contain the name mati (anywhere)

Last edited by djmakinera; 12.10.2015 at 12:11.
  #8  
Old 12.10.2015, 12:49
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 66,134
Default

You cannot ignore some chars. You either accept or deny but not use only part of the input.
__________________
JD-Dev & Server-Admin
  #9  
Old 13.10.2015, 14:13
djmakinera djmakinera is offline
Banned
 
Join Date: May 2010
Location: Poland
Posts: 8,444
Default

What kind of regex? <!>

Example:
<!_-[0-9]> MAYBE WRONG
<!/bth_><!/th_><!/pbprofile><!rss.png><!twitter.png> GOOD
  #10  
Old 13.10.2015, 14:20
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 66,134
Default

what do you want to do?
[0-9] defines a group of chars, you also need a size modifier
[0-9]+ -> at least one
[0-9]* -> none or more
[0-9]{1} -> one
[0-9]{5,} -> five or more
[0-9]{5,9} -> five up to 9
__________________
JD-Dev & Server-Admin

Last edited by raztoki; 13.10.2015 at 15:21. Reason: moe=more
  #11  
Old 13.10.2015, 14:26
djmakinera djmakinera is offline
Banned
 
Join Date: May 2010
Location: Poland
Posts: 8,444
Default

Regex:

eg. may contain only those characters
<b_index=><b_page=><!%20base_url%20>


<!中文ab-&> Only include
!?中AZ& Exclude

Other example:

Quote:
<.wikimedia.org><!/thumb/><!File:>\.([jJ][pP][gG]|[jJ][pP][eE][gG]|[gG][iI][fF]|[pP][nN][gG])$

Last edited by djmakinera; 13.10.2015 at 14:33.
  #12  
Old 13.10.2015, 14:39
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 66,134
Default

you dont need jJ

just put (?i)at the start to enable case-insensitivity
you always need a size modifier when using []!

I'm sorry but I dont understand what you try to do and your regex are all wrong
__________________
JD-Dev & Server-Admin
  #13  
Old 13.10.2015, 14:55
djmakinera djmakinera is offline
Banned
 
Join Date: May 2010
Location: Poland
Posts: 8,444
Default

Quote:
your regex are all wrong
It is a good regex. Of course it can not work in JD2, but in another program works perfectly.

This is - a custom(not standard) regex


https://en.wikipedia.org/wiki/Regular_expression
Code:
\b 	\< \> 	(?<=\W)(?=\w)|(?<=\w)(?=\W) 	Word boundaries

Last edited by djmakinera; 13.10.2015 at 14:58.
  #14  
Old 13.10.2015, 15:20
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 66,134
Default

so you dont need any help. I still dont understand.
__________________
JD-Dev & Server-Admin
  #15  
Old 17.10.2015, 01:07
djmakinera djmakinera is offline
Banned
 
Join Date: May 2010
Location: Poland
Posts: 8,444
Default

@Jiaz - Please correct regex for two different...

https://board.jdownloader.org/showth...ighlight=regex

C:\TEST 123\111138631052\a_125a09c1.zip (WORK)
C:\TEST 123\-111138631052\a_125a09c1.zip (NOT WORK)

Get the number or -number

Edit:

.+\\-(\d+)(_.+)?\\[^\\]+\.zip

.+\\(-\d+)(_.+)?\\[^\\]+\.zip (work)

I wanted to save only the names of all sub-folders in which files are stored.
The database, which I can quickly find in a text editor, or on the disk.
However, the regex with minimal corrections works.
It takes some time to replace to \1 and remove duplicate
To remove duplicates need for other more complex regex or perform an extra step in a text editor

Last edited by Lram32; 05.11.2015 at 19:49. Reason: merged posts
  #16  
Old 17.10.2015, 01:43
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 16,515
Default

Why don't you provide the URL for the example. Im sure your not trying to catch a local windows save path...

Code:
^.+\-?\d+/[a-z0-9_]{10}\.zip$
for url / not save path \
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
  #17  
Old 20.11.2015, 15:47
djmakinera djmakinera is offline
Banned
 
Join Date: May 2010
Location: Poland
Posts: 8,444
Default

How to find all the numbers only an initial number "1" or "-1"


include:
12345_547867
-12345
12345

Ignore:
012345
-01234
0987_10987

Please correct Regex:
HTML Code:
1*[\d_\-]+
^-[1-9]_(\d+)$
^[1-9]_(\d+)$
^[1-9]$
^-[1-9]$

Last edited by Lram32; 11.12.2015 at 16:33.
  #18  
Old 20.11.2015, 15:52
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 16,515
Default

* = repeat zero to unlimited times.
so if you want something that starts with 1 you can use ^
^-?1[\d_\-]+
$ will stipulate the end of a input
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
  #19  
Old 20.11.2015, 15:57
djmakinera djmakinera is offline
Banned
 
Join Date: May 2010
Location: Poland
Posts: 8,444
Default

Code:
^-?1[\d_\-]+
and ignore

1234_0987

and "_"
can not occur more than once, for example.

ignore
12345_12345_12345
-12345_0987_098776_908877

Last edited by Lram32; 11.12.2015 at 16:33.
  #20  
Old 20.11.2015, 16:11
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 16,515
Default

^-?1\d+_\d+
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

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

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 11:04.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.