Page 1 of 1

AND

PostPosted: Tue Aug 20, 2002 2:44 pm
by obvious
I'm wondering if I can build a case insensitive substring search using 'AND' or its equivalent?

e.g. I want to match ("geriatric" OR "GeriaTRic) AND ("Llama" OR 'llAMa') AND ("PROn" OR "prOn") anywhere in the subject line

RE: AND

PostPosted: Wed Aug 21, 2002 1:02 pm
by obvious
LAST EDITED ON 08-21-02 AT 12:05 PM (EST)
I thought the above might be impossible with regex. Are there any plans for alternative filtering for 5.0?

Also, what does everyone think? Should NB just stick to regex parsing or not?

RE: AND

PostPosted: Wed Aug 21, 2002 3:30 pm
by Quade
Well, all the RE is case independent so, it doesn't matter what case you're using. I was hoping Dexter would answer since he's more of an RE expert than I am.

My own thought is that RE's too much for most people. I'm thinking the default filtering should be like "The Bat" filtering.

RE: AND

PostPosted: Wed Jan 01, 2003 12:17 am
by n4aof
>My own thought is that RE's
>too much for most people.

AMEN!

PostPosted: Mon Apr 28, 2003 7:13 pm
by bigbear
The case insensitive part of the question got answered, but the AND part didn't.

How can I create and expression that finds "foo" AND "bar" (without the quotes of course!). I know I can do "foo|bar", which would find anything that had "foo" OR "bar".

Is there an AND operator in RegEx?

PostPosted: Mon Apr 28, 2003 10:04 pm
by kewakl
bigbear wrote:Is there an AND operator in RegEx?


Do not think so in NewsBin's implementation.
Goto http://www.newsbin.com/nb33help/regexp.htm for a bit of Regex info.
Dex still hasn't fixed the link listed in http://forums.newsbin.com/viewtopic.php?t=4322
It includes the period at the end of the sentence--so your browser will return a page not found error.

PostPosted: Tue Apr 29, 2003 1:50 am
by Smite
For now you can do foo and bar like so:
(foo.*bar)|(bar.*foo)

PostPosted: Tue Apr 29, 2003 6:24 am
by kewakl
Smite wrote:For now you can do foo and bar like so:
(foo.*bar)|(bar.*foo)


Yeah, but that performs an 'OR' operation.

PostPosted: Tue Apr 29, 2003 11:50 am
by bigbear
[quote="kewakl"][quote="Smite"]For now you can do foo and bar like so:
(foo.*bar)|(bar.*foo)[/quote]

Yeah, but that performs an 'OR' operation.[/quote]

That expression does *exactly* what I want. I haven't figured out the RegEx logic and why it works, but call it what you will (tomayto/ tomahto), it does work!

Thanks to all who participated.

PostPosted: Wed Apr 30, 2003 3:19 am
by Smite
Sure it performs an or, but any logic expression can be represented using only the not, or, and umm, I forget the other one, maybe conditional.. :P

Anyhow, that's really here nor there.

If a string contains A and B, it will either contain A followed sometime later by B, or by B followed sometime later by A. That's what that RegEx checked for.

PostPosted: Thu May 01, 2003 12:51 am
by kewakl
Smite wrote:Sure it performs an or, but any logic expression can be represented using only the not, or, and umm, I forget the other one, maybe conditional.. :P

Anyhow, that's really here nor there.

If a string contains A and B, it will either contain A followed sometime later by B, or by B followed sometime later by A. That's what that RegEx checked for.


And when I unplugged my head from my.... I read the post and realized that! :oops:

PostPosted: Sun Jun 15, 2003 2:54 am
by bagera
so:
d.*r.*u.*n.*k
Will filter out drunk, d-r-u-n-k, d_r_u_n_k

life as a spammer
employer: What's yur typing speed?

spammer applicant: I c-a-n t-y-p-e

employer: In your portfolio here. What would you say that tattoo of the knife thru your moms head represents?

PostPosted: Sun Jun 15, 2003 4:55 am
by Smite
d.*r.*u.*n.*k will also match:
"Devilish parties are the brunt of many heavenly pranks."

So be carefull how you use that .*

PostPosted: Sun Jun 15, 2003 5:05 pm
by bagera
How could make it more fool.*proof

Spose I could just add all the variables.
drunk|d-r-u-n-k|d_r_u_n_k|d,r,u,n,k

life as a spammer continued
spammer applicant: I have a knife for every $#%&#*& who doesn't appreciate my generous contributions to usernet. Ahh my mom wouldn't buy my p0rn so I axed her why.

PostPosted: Sun Jun 15, 2003 5:31 pm
by Smite
Well, if you expect a single extra character between each character, you could just use d.r.u.n.k

PostPosted: Sun Jun 15, 2003 5:33 pm
by bagera
d[^a-z]r[^a-z]u[^a-z]n[^a-z]k
d[a-z]r[a-z]u[a-z]n[a-z]k

Will this work does this constrain the filter to one word?
Is a space considered a character will this get d r u n k?
Thanks smite I like yours better.

I keep visiting http://www.newsbin.com/nb33help/regexp.htm
and it's a real handy page however it could use some practical appications for us technically challenged.

Perhapse some pre built filters to cut and paste into NBPro. with explanations on why they work. Or they could be included in NBPro similar to the mail merge fields. Wow I'm on a roll here. When can you implement that and wheres my fee for this incredible new feature.

Once again,

PostPosted: Mon Apr 02, 2007 4:18 pm
by Quasi
Once again, you guys are my heros. I've been trying to figure out how to search for certain titles (alt.bin.e-book.tec) while excluding all of what I wasn't looking for. ie, introduction books for geometry. Now, with the above post, I can do that!

Thanks again for the help and the great product.

PostPosted: Wed Apr 04, 2007 12:28 am
by bobkoure
If you're interested in learning regular expressions, another good place to look is Links not allowed for unregistered users.
If you use a text editor that supports it, it becomes a lot easier to learn (you can see what you're doing) but (assuming you need to manipulate text) is incredibly useful.