-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Mar 30, 2011, at 2:08 PM, Noel Jones wrote: > On 3/30/2011 3:53 PM, Ansgar Wiechers wrote: >> On 2011-03-30 Corey Quinn wrote: >>> On Mar 30, 2011, at 12:46 PM, Noel Jones wrote: >>>> # main.cf >>>> smtp_generic_maps = >>>> regexp:/etc/postfix/generic.regexp >>>> >>>> # generic.regexp >>>> IF /+.*@example\.com$/ >>>> /^(.*)+/ $1...@example.com >>>> ENDIF >>> >>> Threw this verbatim into my generic.regexp: >>> >>> [root@mx1 postfix]# postmap -q "user+t...@example.com" regexp:generic.regexp >>> postmap: warning: regexp map generic.regexp, line 1: Invalid preceding >>> regular expression >>> postmap: warning: regexp map generic.regexp, line 4: ignoring ENDIF without >>> matching IF >>> user+t...@example.com@example.com >>> >>> On the plus side, I figured out how to do something interesting by >>> reading through the regexp documentation-- this solved another >>> challenge I'd been facing. >> >> '+' has a special meaning in regular expressions (one or more times the >> preceding term), so you need to escape it to match a literal '+': >> >> if /\+.*@example\.com$/ >> /^(.*)\+/ $1...@example.com >> endif >> >> Regards >> Ansgar Wiechers > > > that's what I get for posting an untested example and then walking away for a > little while. > > Escaping the "+" fixes the expression to what I intended. > > Thanks everyone for cleaning up after me. > Thanks-- that sorted it, and now I'm able to say I learned two new things about regular expressions today. Only several thousand left to go. - -- Corey / KB1JWQ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) iQEcBAEBAgAGBQJNlCIHAAoJEPmSS8816iBeorUH/A+6vAdxQzUYZRTrjEx1eEdY 22QDpB23TXqAPux6dXtSiRqFewIlLTe3IjmI6+DB6ye7767JjdcGQCHOq+/zJbiA SEBpfueI+sYCQtQ3gO17diN+2YIp/Z1v+6P6TrjILifvh4Fhxq9GrMiv3lxnlrgQ z+RcD41RshqempvSxDHIs1BzB+TRsKWoEo/SucYzfABtERxRwcclfGvPXv/4Rna5 bUqG3iJFqwcHOadMkTH96rSXeNeTTBKnKHz4J6v3pPHu5HL8UIuX4xK+qTmKIfNY 6v+BMuvWOI9XldZ+2Obo+NPbKdMtiVwh/DgHlqGnu0os3cvGOuyuFlFGriCNjEE= =0I35 -----END PGP SIGNATURE-----