procmail
[Top] [All Lists]

Re: ER with brackets don't works

2006-08-16 14:29:18


Ruud H.G. van Tol schrieb:
Matthias Häker schreef:

  
   S = '[^ ]?'
   V = '([Vv]|\/|\||\|/)'
   I = '[Ii1l|]'
   A = '([Aa]|/\)'
   G = '[Gg9]'
   R = '[Rr]'
          
i like to give the above a try but i get a invalid regex

procmail: Assigning "S=[^$WS]?"
procmail: Assigning "V=([Vv]|\/|\||\|/)"
procmail: Assigning "I=[Ii1l|]"
procmail: Assigning "A=([Aa]|/\)"
procmail: Assigning "G=[Gg9]"
procmail: Assigning "R=[Rr]"
procmail: Assigning "MATCH="
procmail: Matched " forecast"
procmail: Match on "^Subject:\/.*"
procmail: Invalid regexp

    
"([Vv]|\/|\||\|/)[^$WS]?[Ii1l|]+[^$WS]?([Aa]|/\)+[^$WS]?[Gg9][^$WS]?[Rr]
[^$WS]?([Aa]|/\)"
  
can anybody explain please
    


(1) If you use $WS in setting S, then you need to use dquotes for
interpolation.

    S = "[^$WS]?"

    You do set WS = '<space><tab>' (2 characters, ASCII-32 and ASCII-9)
earlier, right?


(2) I forgot to escape some backslashes and vbars:

    V = '([Vv]|\\/|\\\||\|/)'

    A = '([Aa]|/\\)'


  


thank you  ruud that did the trick:

    S = "[^$WS]?"
    V = '([Vv]|\\/|\\\||\|/)'
    I = '[Ii1l|]'
    A = '([Aa]|/\\)'
    G = '[Gg9]'
    R = '[Rr]'
    :0:
    * ^Subject:\/.*
    *$ MATCH ?? $V$S$I+$S$A+$S$G$S$R$S$A
    $home/suspicious

Assigning "S=[^         ]?"
Assigning "V=([Vv]|\\/|\\\||\|/)"
Assigning "I=[Ii1l|]"
Assigning "A=([Aa]|/\\)"
Assigning "G=[Gg9]"
Assigning "R=[Rr]"
Assigning "MATCH="
Matched " forecast"
Match on "^Subject:\/.*"
No match on "([Vv]|\\/|\\\||\|/)[^      ] # all in one line
?[Ii1l|]+[^     ]?([Aa]|/\\)+[^         ]? # 
[Gg9][^         ]?[Rr][^        ]?([Aa]|/\\)"



Matthias

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>