Page 1 of 1

Regular expression to select non-matching pattern

PostPosted: Sat May 27, 2006 8:24 am
by Neuron111
Hi All,

This may be very basic.
I want to select lines containing non-matching pattern.

For example if we consider following cities:
London
NewYork
Delhi
Mountainview

If above are the given then how to select all cities except "Delhi"

Please suggest. Thanks.

PostPosted: Sat May 27, 2006 11:59 am
by Quade
If you're talking about the filter profiles, I'd reject
"Delhi". If you only want to see these cities I'd accept

London
NewYork
Mountainview

Basically "reject" is like "NOT" where the accept filters are like "OR".

Re:Regular expression to select non-matching pattern

PostPosted: Mon May 29, 2006 2:26 am
by Neuron111
Thanks Quade for the reply. Sorry but I didn't get you, please can you explain!!! Actually I am looking for one line regular expression that will be "not" of any word, in this example "Delhi".

PostPosted: Mon May 29, 2006 2:48 am
by itimpi
As far as I know there is no regular expression to reject items containing specific strings.

If you Use Newsbin's filter profiles there are, however, both accept and reject options so via that method posts can be rejected.

PostPosted: Mon May 29, 2006 2:51 am
by Neuron111
Ohh ok. I am trying regular expressions in java and am stuck over here for this solution.

PostPosted: Mon May 29, 2006 3:08 am
by Quade
Yeah, this is regular expressions FOR NEWSBIN, not a generic regular expressions topic.

PostPosted: Mon May 29, 2006 3:11 am
by Neuron111
Sorry can anyone suggest which one is the appropriate forum where this can be posted.
And yes if anyone knows the solution that will be great help!!!

PostPosted: Mon May 29, 2006 9:48 am
by DThor
A java or regular expression forum springs to mind. Have you tried google? There's hundreds of help sites out there.

DT

PostPosted: Mon May 29, 2006 1:01 pm
by Neuron111
Ya man I tried google and was not able to come up with solution.
Will definitely update if I get the solution.

PostPosted: Mon May 29, 2006 4:37 pm
by Kiltme
While regex doesn't have a not match operator the containing program can.

You just invert the logical operation that had the regex find in it.

if ($Town =~ /Delhi/) # contains Delhi
if !($Town =~ /Delhi/) # doesn't contain Delhi

This comes up about newsbin and filtering the post list regularly.

If newsbin could process the ! logic, the post list would be easier to use :twisted:

PostPosted: Tue May 30, 2006 4:14 pm
by obvious
Kiltme wrote:If newsbin could process the ! logic, the post list would be easier to use :twisted:

:twisted: