The Adblock Project Forum Index The Adblock Project
Pull up a seat ...stay a while.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Unordered matching

 
Post new topic   Reply to topic    The Adblock Project Forum Index -> Main
View previous topic :: View next topic  
Author Message
SnarlCat



Joined: 26 Oct 2004
Posts: 55

PostPosted: Thu Oct 28, 2004    Post subject: Unordered matching Reply with quote

All-

Another question about pattern matching...

How would I go about matching three substrings in an abitrary order? ... the permutations of a set, I suppose.

Example:
Using {foo, bar, snafu}, match URLs such as:
foo-bar-snafu
bar-foo-snafu
foo-snafu-bar
bar-snafu-foo
etc.

I was thinkin' it be similar to ((foo|bar|snafu)?){3}, but this would also match patterns such as foo-foo-foo, which I don't necessarily want.

I'm looking to block URLs that include the HTTP header information (browser, OS, verions, etc).

Thoughts or ideas?

Thanks!

SnarlCat
_________________
--
"There are 11 types of people -- those that understand binary, those that don't, and those that think they do."
Back to top
View user's profile Send private message
rue
Developer


Joined: 22 Oct 2003
Posts: 752

PostPosted: Thu Oct 28, 2004    Post subject: Reply with quote

SnarlCat:
/((foo(?!.*foo)|bar(?!.*bar)|snafu(?!.*snafu))((.(?!foo|bar|snafu))*.)?){3}/
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The Adblock Project Forum Index -> Main All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group