Page 1 of 1

Poptray exits when checking RegExp ^??@domain.net$

Posted: Thu Feb 16, 2006 7:43 pm
by Gerard Stutje
Hello!

Everything that comes into the catch-all mail box of my domain that has only two characters for a user name is spam, so I want to delete everything sent to aa@domain.net, bb@domain.net, etc.

The rule To: regular expression ^\w\w@domain.net$ does not work which is probably my fault, I must have missed something.

BUT:

When I try the rule To: regular expression ^??@domain.net?$, Poptray dismisses itself and disappears from the tasklist.

Posted: Thu Feb 16, 2006 8:37 pm
by freewareguide
Hello,

isn't it ^.?.?@domain\.net$ ?
Stupid me, just ^..@domain\.net$ ?
Or better ^[\w]{2}@domain\.net$ ?

I have not tried in PopTray.
A good source is Regular-Expressions.info.

Regards,
Thorsten

Posted: Thu Feb 16, 2006 9:28 pm
by Gerard Stutje
Hallo Thorsten,
freewareguide wrote: isn't it ^.?.?@domain\.net$ ?
Stupid me, just ^..@domain\.net$ ?
Or better ^[\w]{2}@domain\.net$ ?
Sadly enough, none of those work as expected.

BUT Even if I add the \ before the .net, Poptray still quits automagically.

To: RegExpr ^??@domain\.net$ makes Poptray disappear.

It's about the bug, not about me not understanding how the rules work. ;-)

Vielen Dank anyway.

Posted: Thu Feb 16, 2006 9:50 pm
by freewareguide
Hello,

but ^??@ is still wrong, or what am I missing? The "\ before the .net" is just to make it more precise (even a dot is matched by the "any character" dot), the problem is in the doubled question mark, I believe. A question mark tells about the amount of the characters defined before (zero or one), like * or +. You have not defined any char before. I think, you mixed up with wildcards for example on the command line.

Don't get me wrong, no app should just quit in such a case, a error message should appear.

Regards,
Thorsten

Posted: Fri Feb 17, 2006 2:48 am
by Rdsok
@Gerard Stutje


Don't use the question mark ? as a wildcard for a single character... use a period . for what you are wanting

example

^..@domain\.net$


What is happening is that what you did created a logical error that the regexpr library used can't test

Read the RegExpr guide that is linked to in my sig for more info.