JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #41  
Old 26.04.2019, 14:31
djmakinera djmakinera is offline
JD Legend
 
Join Date: May 2010
Location: Poland
Posts: 8,297
Default

I tried a regular expression, but I see that it still finds such a word:
Quote:
Про Нижнее бельё

^(?!www|https?:).*[^\!'(),.:;?="А-Яа-я]$

Example1:
Mój człowiek musi najpierw mnie zrozumieć. Wszystkie moje załamania i dziwactwa, które przy okazji mi wystarczają

Example2:
Mój człowiek musi najpierw mnie zrozumieć. Wszystkie moje załamania i dziwactwa, które przy okazji mi wystarczają. Zrozumcie moje hobby i zainteresowania. Dla mnie jest to bardzo ważne, gdy dana osoba jest zainteresowana moimi hobby, a przynajmniej stosuje swoją siłę, aby zrozumieć. Potrzebuję kogoś, kto będzie ze mną na tej samej częstotliwości!

Example3:
Mój człowiek musi najpierw mnie zrozumieć. Wszystkie moje załamania i dziwactwa, które przy okazji mi wystarczają. Zrozumcie moje hobby i zainteresowania. Dla mnie jest to bardzo ważne, gdy dana osoba jest zainteresowana moimi hobby, a przynajmniej stosuje swoją siłę, aby zrozumieć. Potrzebuję kogoś, kto będzie ze mną na tej samej częstotliwości?

Example4:
===
Potrzebuję kogoś, kto będzie ze mną na tej samej częstotliwości

Example5:
Mój człowiek musi najpierw mnie zrozumieć.
Reply With Quote
  #42  
Old 26.04.2019, 17:31
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 65,502
Default

And what is wrong with that? I don't see any difference from *such a word* to your rest text
__________________
JD-Dev & Server-Admin
Reply With Quote
  #43  
Old 26.04.2019, 17:37
djmakinera djmakinera is offline
JD Legend
 
Join Date: May 2010
Location: Poland
Posts: 8,297
Default

^(?!www|https?:).*[^\!'(),.:;?="аАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяЯ]{1}$

Something is wrong, it is not only the last but one of any allowed character (end line)
{1}
Reply With Quote
  #44  
Old 26.04.2019, 18:01
djmakinera djmakinera is offline
JD Legend
 
Join Date: May 2010
Location: Poland
Posts: 8,297
Default

Quote:
Originally Posted by Jiaz View Post
And what is wrong with that? I don't see any difference from *such a word* to your rest text
Not words, but character, make differences.
Reply With Quote
  #45  
Old 27.04.2019, 17:50
djmakinera djmakinera is offline
JD Legend
 
Join Date: May 2010
Location: Poland
Posts: 8,297
Default

Regex to find all sentences of text?
Sentences <end with '.','?' or '!'>.

Enabled Regex:
[^.!?0-9]+[.!?]

[x]Enabled Count Matches


Regular expression correct, but should ignore all links www,http and https
Example:
**External links are only visible to Support Staff****External links are only visible to Support Staff**
Reply With Quote
  #46  
Old 29.04.2019, 16:07
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 65,502
Default

Quote:
^(?!https?:).*(\.|!|,|,)\s*$
maybe like this
__________________
JD-Dev & Server-Admin
Reply With Quote
  #47  
Old 29.04.2019, 19:03
djmakinera djmakinera is offline
JD Legend
 
Join Date: May 2010
Location: Poland
Posts: 8,297
Default

Quote:
Originally Posted by Jiaz View Post
maybe like this
Unfortunately, but an incorrect expression.
Count 2 matches. Should count in this case: 10 matches.

**External links are only visible to Support Staff****External links are only visible to Support Staff**
Reply With Quote
  #48  
Old 29.04.2019, 19:36
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 65,502
Default

There are only 2 lines in your examples, see 1 and 2 on the left. so only 2 matches
__________________
JD-Dev & Server-Admin
Reply With Quote
  #49  
Old 29.04.2019, 20:33
djmakinera djmakinera is offline
JD Legend
 
Join Date: May 2010
Location: Poland
Posts: 8,297
Default

Quote:
Originally Posted by Jiaz View Post
There are only 2 lines in your examples, see 1 and 2 on the left. so only 2 matches
Quote:
Originally Posted by djmakinera View Post
Regex to find all sentences of text?

See my regex:
Here shows 10 counter + 2 counter (no link needed!).
So here is something to improve.

**External links are only visible to Support Staff****External links are only visible to Support Staff**
Reply With Quote
  #50  
Old 30.04.2019, 10:12
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 65,502
Default

But a sentence doesn't end with , ?
So you already have a working pattern, so why asking for help?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #51  
Old 30.04.2019, 12:32
djmakinera djmakinera is offline
JD Legend
 
Join Date: May 2010
Location: Poland
Posts: 8,297
Default

Quote:
Originally Posted by Jiaz View Post
But a sentence doesn't end with , ?
So you already have a working pattern, so why asking for help?
Sentences <end with '.','?' or '!'>.

You misinterpreted. The comma in this case was the dividing sentence.
Regex - It does not work properly because it includes some characters in the links, even a dot in the links.
And links are not sentences!
Reply With Quote
  #52  
Old 30.04.2019, 19:12
djmakinera djmakinera is offline
JD Legend
 
Join Date: May 2010
Location: Poland
Posts: 8,297
Default

/^(www|https?:\/\/)?
the letters www, http or https

([\da-z\.-]+)\.([a-z\.]{2,6})
any number a dot ...two to six

([/\w\.-]*)\/?$/
letters,numbers, underscores,dots, or hyphens

[^.!?0-9]+[.!?]
Count Matches Sentences

?!
Negative Lookahead

Not work for me:
[^.!?0-9]+[.!?]/^(?!www|https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/
Reply With Quote
  #53  
Old 30.04.2019, 20:03
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 65,502
Default

The pattern is invalid, for example
(?!www|https?:\/\/)?
you can't use negative lookahead but then make it optional with ?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #54  
Old 30.04.2019, 21:00
djmakinera djmakinera is offline
JD Legend
 
Join Date: May 2010
Location: Poland
Posts: 8,297
Default

I have corrected, but still regular expression is not correct.

Code:
ERROR
The complexity of matching the regular expression exceeded predefined bounds.  Try refactoring the regular expression to make each choice made by the state machine unambiguous.  This exception is thrown to prevent "eternal" matches that take an indefinite period time to locate.
Reply With Quote
  #55  
Old 01.05.2019, 00:03
djmakinera djmakinera is offline
JD Legend
 
Join Date: May 2010
Location: Poland
Posts: 8,297
Default

The expression should be corrected:
1. It can not include links (because it contains these characters . ! ?)
?! Negative Lookahead NOT WORK

2. He can not tolerate simple names, for example:
Меары А. С. Одинцой
must have at least two characters

3. Ignore Cyrylic

[^.!?0-9\p{Cyrillic}]+[.!?](?!https?:\/\/(www\.)[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*))
Reply With Quote
  #56  
Old 02.05.2019, 17:22
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 65,502
Default

Negative Lookahead works fine but you cannot use it in combination with ?
Quote:
(?!https?:\/\/(www\.) is correct
(?!https?:\/\/(www\.)? is invalid. you specify that this text may not be present and yet want it optional with ?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #57  
Old 02.05.2019, 17:23
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 65,502
Default

You should really start to learn conding in a language and not try to solve all problems with regex!
__________________
JD-Dev & Server-Admin
Reply With Quote
  #58  
Old 02.05.2019, 17:39
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 16,204
Default

its powerful, just cant solve all yours queries ;p
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
Reply With Quote
  #59  
Old 03.05.2019, 16:26
djmakinera djmakinera is offline
JD Legend
 
Join Date: May 2010
Location: Poland
Posts: 8,297
Default

I do not need to know everything, I see nothing wrong with it, but in some cases a regular expression may work, maybe not in my case. You can find similar expressive examples on the other forum, and here everything is fine, but not in my case. So I have to include sentences in links, there is no other solution, it does not exist.
Reply With Quote
  #60  
Old 04.05.2019, 03:45
djmakinera djmakinera is offline
JD Legend
 
Join Date: May 2010
Location: Poland
Posts: 8,297
Default

Quote:
(?!https?:\/\/(www\.) is correct
The regular expression contains mismatched '(' and ')'.


(?!http|https):\/\/(www\.)[\w\-_]+(\.[\w]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])

Code:
/ An unescaped delimiter must be escaped with a backslash (\)
The regular expression is correct, but on regex101.com
Indicates that the pattern error.

?! does not ignore links, instead of ignoring it is still a match!
Reply With Quote
Reply

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 15:06.
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 - 2019, Jelsoft Enterprises Ltd.