About regular expressions

Get answers to your Shareaza related problems.
Forum rules
Home | Wiki | Rules

About regular expressions

Postby eddyreen » 01 Jun 2010 05:19

I am using regular expressions to block spam hits.
This works really great but i do have some problems.

Some spammers will take your search term/s &Capitalize the first letter,
as i am using <_> for exact match they will get through .
Is there any way of making it case insensitive ?

Some spammers will take your search term/s &change their order like <3> <1> <2> or <2> <3> <1> <5> <4>
as i am using <_> for exact match they will get through .
Is there any way of making it order insensitive ?

I've read the wiki &some links there without succes .
Is it possible :roll:

I also had an idea:
What if Shareaza would add an extra random searchterm automattically like 'NoSpamPlease'
&then filter out any results with 'NoSpamPlease'
Could it work 8-)
User avatar
eddyreen
 
Posts: 42
Joined: 05 Apr 2010 01:35

Re: About regular expressions

Postby eddyreen » 01 Jun 2010 10:34

Forget about my idea 'NoSpamPlease' doesn't work :lol:
It would work if Shareaza did a 'match any'
Unfortunately it does a 'match all'
Damn :|
User avatar
eddyreen
 
Posts: 42
Joined: 05 Apr 2010 01:35

Re: About regular expressions

Postby cyko_01 » 02 Jun 2010 00:36

shareaza regexps are already case insensitive by design
User avatar
cyko_01
 
Posts: 938
Joined: 13 Jun 2009 15:51

Re: About regular expressions

Postby eddyreen » 04 Jun 2010 13:14

I think i figured it out :D

^(xxx\.sex\.girls\.)
((<1>)|(<2>)|(<3>)|(<4>)|(<5>)|(<6>)|(<7>)|(<8>)|(<9>))
(( <1>)|( <2>)|( <3>)|( <4>)|( <5>)|( <6>)|( <7>)|( <8>)|( <9>)|())
(( <1>)|( <2>)|( <3>)|( <4>)|( <5>)|( <6>)|( <7>)|( <8>)|( <9>)|())
(( <1>)|( <2>)|( <3>)|( <4>)|( <5>)|( <6>)|( <7>)|( <8>)|( <9>)|())
(( <1>)|( <2>)|( <3>)|( <4>)|( <5>)|( <6>)|( <7>)|( <8>)|( <9>)|())
(( <1>)|( <2>)|( <3>)|( <4>)|( <5>)|( <6>)|( <7>)|( <8>)|( <9>)|())
(( <1>)|( <2>)|( <3>)|( <4>)|( <5>)|( <6>)|( <7>)|( <8>)|( <9>)|())
(( <1>)|( <2>)|( <3>)|( <4>)|( <5>)|( <6>)|( <7>)|( <8>)|( <9>)|())
(( <1>)|( <2>)|( <3>)|( <4>)|( <5>)|( <6>)|( <7>)|( <8>)|( <9>)|())
(\.avi)$

This will filter 'xxx.sex.girls.<SearchtermsOrderInsensitive>.avi' regardless how many searchterms you've used (up to 9).
There is just one little hitch;
This rule also filters <1> <1> <1>
&ofcourse order insensitive should not allow multiple occurences of the same searchterm :|

Boaargh, good enough for me :mrgreen:
User avatar
eddyreen
 
Posts: 42
Joined: 05 Apr 2010 01:35

Re: About regular expressions

Postby eddyreen » 04 Jun 2010 14:30

One other question;
I am trying to block a result by it's HASH
this is how i do it;
First i select the BOGUS file for download,
Pause the download,
go to file properties,
copy the SHA1 value,
cancel the download,
goto security window,
add new filter;
content filter
urn:sha1:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

it is not working :?: 0(0) hits :?:
The file is still in search results :roll:
User avatar
eddyreen
 
Posts: 42
Joined: 05 Apr 2010 01:35

Re: About regular expressions

Postby cyko_01 » 04 Jun 2010 22:27

User avatar
cyko_01
 
Posts: 938
Joined: 13 Jun 2009 15:51

Re: About regular expressions

Postby eddyreen » 05 Jun 2010 05:11

User avatar
eddyreen
 
Posts: 42
Joined: 05 Apr 2010 01:35

Re: About regular expressions

Postby eddyreen » 05 Jun 2010 08:32

Aaargh Shareaza hanged while adding my security rule &if i start it again it hangs too CPU 100% for about 15mins,
Where can i delete/reset the security filter when i am unable to start Shareaza :|

Really, i'm getting frustrated :cry:
User avatar
eddyreen
 
Posts: 42
Joined: 05 Apr 2010 01:35

Re: About regular expressions

Postby eddyreen » 05 Jun 2010 10:02

Did a reinstall to a previous version 2.4.0.0

Aparantly it has to be like this :arrow:

^(HitTerm)
((<1>)|(<2>)|(<3>)|(<4>)|(<5>)|(<6>)|(<7>)|(<8>)|(<9>))
(( )((<1>)|(<2>)|(<3>)|(<4>)|(<5>)|(<6>)|(<7>)|(<8>)|(<9>)))?
(( )((<1>)|(<2>)|(<3>)|(<4>)|(<5>)|(<6>)|(<7>)|(<8>)|(<9>)))?
(( )((<1>)|(<2>)|(<3>)|(<4>)|(<5>)|(<6>)|(<7>)|(<8>)|(<9>)))?
(( )((<1>)|(<2>)|(<3>)|(<4>)|(<5>)|(<6>)|(<7>)|(<8>)|(<9>)))?
(( )((<1>)|(<2>)|(<3>)|(<4>)|(<5>)|(<6>)|(<7>)|(<8>)|(<9>)))?
(( )((<1>)|(<2>)|(<3>)|(<4>)|(<5>)|(<6>)|(<7>)|(<8>)|(<9>)))?
(( )((<1>)|(<2>)|(<3>)|(<4>)|(<5>)|(<6>)|(<7>)|(<8>)|(<9>)))?
(( )((<1>)|(<2>)|(<3>)|(<4>)|(<5>)|(<6>)|(<7>)|(<8>)|(<9>)))?
(HitTerm)
(\.avi)$

Hey CYKO did you know that if you enter wrong regexps you can actiually HANG Shareaza :idea:
This WILL HANG SHAREAZA;
(( )((<1>)|(<2>)|(<3>)|(<4>)|(<5>)|(<6>)|(<7>)|(<8>)|(<9>))?
User avatar
eddyreen
 
Posts: 42
Joined: 05 Apr 2010 01:35

Re: About regular expressions

Postby eddyreen » 05 Jun 2010 12:25

OK then, this is my last attempt. I've been trying very hard for several hours ! :arrow:

^(HitTerm)
((<1>)|(<2>)|(<3>)|(<4>)|(<5>)|(<6>)|(<7>)|(<8>)|(<9>))
(( )((<1>)|(<2>)|(<3>)|(<4>)|(<5>)|(<6>)|(<7>)|(<8>)|(<9>)))?
(( )((<1>)|(<2>)|(<3>)|(<4>)|(<5>)|(<6>)|(<7>)|(<8>)|(<9>)))?
(( )((<1>)|(<2>)|(<3>)|(<4>)|(<5>)|(<6>)|(<7>)|(<8>)|(<9>)))?
(( )((<1>)|(<2>)|(<3>)|(<4>)|(<5>)|(<6>)|(<7>)|(<8>)|(<9>)))?
(( )((<1>)|(<2>)|(<3>)|(<4>)|(<5>)|(<6>)|(<7>)|(<8>)|(<9>)))?
(( )((<1>)|(<2>)|(<3>)|(<4>)|(<5>)|(<6>)|(<7>)|(<8>)|(<9>)))?
(( )((<1>)|(<2>)|(<3>)|(<4>)|(<5>)|(<6>)|(<7>)|(<8>)|(<9>)))?
((.*)((<1>)|(<2>)|(<3>)|(<4>)|(<5>)|(<6>)|(<7>)|(<8>)|(<9>)))?
(HitTerm)
(\.ext)$

This will filter order insensitive :)
One hitch;
<1> <1> <1> will also match so not really order insensitive !

Why i have to use (.*) at the end is a mystery to me, but it won't work without it .

You may wonder why i am making things so complex well,
I want to catch as many bogus results as possible &avoid catching a valid result at all costs :ugeek:
User avatar
eddyreen
 
Posts: 42
Joined: 05 Apr 2010 01:35

Re: About regular expressions

Postby cyko_01 » 05 Jun 2010 14:30

User avatar
cyko_01
 
Posts: 938
Joined: 13 Jun 2009 15:51

Re: About regular expressions

Postby cyko_01 » 05 Jun 2010 14:53

User avatar
cyko_01
 
Posts: 938
Joined: 13 Jun 2009 15:51

Re: About regular expressions

Postby eddyreen » 05 Jun 2010 17:33

This is what i have now :arrow:

^(HitTerm)
((<1>)|(<2>)|(<3>)|(<4>)|(<5>)|(<6>)|(<7>)|(<8>)|(<9>))
((\s)((<1>)|(<2>)|(<3>)|(<4>)|(<5>)|(<6>)|(<7>)|(<8>)|(<9>)))*
((.*)((<1>)|(<2>)|(<3>)|(<4>)|(<5>)|(<6>)|(<7>)|(<8>)|(<9>)))?
(HitTerm)
(\.ext)$

The first line makes sure the result begins with at least 1 SearchTerm right after the HitTerm.
The second line matches all other SearchTerms.
The third line matches 0 or the last SearchTerm, (it has to stay there because i could not get rid of (.*), Shareaza bug :?: )

Thanks, REALLY ;)

Here's where i studied your suggestions (very useful guide); http://www.regular-expressions.info/tutorialcnt.html
Last edited by eddyreen on 08 Jun 2010 11:13, edited 1 time in total.
User avatar
eddyreen
 
Posts: 42
Joined: 05 Apr 2010 01:35

Re: About regular expressions

Postby eddyreen » 06 Jun 2010 13:48

Some Spammers think they are really smart by placing a space at the end after the FileExtension :D

This one will catch those 'smart' f*@s aswell :arrow:

^(HitTerm)
((<1>)|(<2>)|(<3>)|(<4>)|(<5>)|(<6>)|(<7>)|(<8>)|(<9>))
((\s)((<1>)|(<2>)|(<3>)|(<4>)|(<5>)|(<6>)|(<7>)|(<8>)|(<9>)))*
((.*)((<1>)|(<2>)|(<3>)|(<4>)|(<5>)|(<6>)|(<7>)|(<8>)|(<9>)))?
(HitTerm)
(\.ext)(\s*)$
:lol: :lol: :lol:
User avatar
eddyreen
 
Posts: 42
Joined: 05 Apr 2010 01:35

Re: About regular expressions

Postby eddyreen » 08 Jun 2010 11:09

Inserting all these rules is a lot of work &I am veeery laaazy !

I was thinking about writing an AutoIT script;

-Abort when maximum limit of rules has been reached .
-Look for a file that definetly does not exists .
-Insert a new security rule if it hits that will time out after XXX .
-LOOP

It would be even better if I wrote a plugin, but unfortunately I lak the skills.

I really wonder why noone else has had this idea before .

Does something similar already exist :?:
User avatar
eddyreen
 
Posts: 42
Joined: 05 Apr 2010 01:35

Re: About regular expressions

Postby cyko_01 » 08 Jun 2010 13:08

User avatar
cyko_01
 
Posts: 938
Joined: 13 Jun 2009 15:51

Re: About regular expressions

Postby eddyreen » 08 Jun 2010 13:48

User avatar
eddyreen
 
Posts: 42
Joined: 05 Apr 2010 01:35


Return to Help and Support

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron