From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> 
> Joe Kletch wrote:
> >> header   __PORN_WORD12  Subject =~/(?:d(?:ic|ci)k|c(?:|oc|co)k/i
> >> 
> >> Unfortunately I don't understand regexp, any suggestions for
> >> fixing this?  If I remove the lint test report is good.
> >> 
> > 
> > Through trial and error I found that removing the third '('
> > made lint happy. I hope I didn't change the intent of the rule:
> > This works:
> > header   __PORN_WORD12  Subject =~/(?:d(?:ic|ci)k|c?:|oc|co)k/i
> 
> You did change the intent of the rule
> 
> I'm having trouble reconstructing the original intent, though...
> header   __PORN_WORD12  Subject =~/(?:d(?:ic|ci)k)|c(?:|oc|co)k/i
> or
> header   __PORN_WORD12  Subject =~/(?:d(?:ic|ci)k|c(?:|oc|co)k)/i

I think it is more likely to be this:
header   __PORN_WORD12  Subject =~/d(?:ic|ci)k|c(?:oc|co)k/i

It will match manglings of either word.  I don't see any value in
the extra grouping around the whole pattern.  Also, the other
example you provided in your original email did not have them.

I also took out the blank option in the second half of the pattern.
I don't think you really want a match for just "ck".

I'm wondering about false matches.  Without any word boundaries,
this rule will produce some false matches.  In particular, words
like "cockatoo" and "dickson" will match this rule.  This may be
taken care of elsewhere in the ruleset, though.

Bowie

Reply via email to