[rt-users] RTAddressRegexp wildcard question

Paul Hoffman paul at flo.org
Fri Jul 8 12:07:25 EDT 2011


On Fri, Jul 08, 2011 at 11:52:50AM -0400, Joseph Spenner wrote:
> I'm using RT 3.8.8 and trying to modify my RTAddressRegexp such that the following get matched:
> 
> blue-house at domain.com
> blue-car at domain.com
> blue-truck at domain.com
> red-house at domain.com
> red-engine at domain.com
> red-bike at domain.com
> thing at domain.com
> 
> My goal is to catch anything beginning with "blue-" or "red-", or equal to "thing" before the @.  Can a * be used in RTAddressRegexp ?
> 
> ie:
> 
> Set($RTAddressRegexp , '^(blue-|red-|thing)*\@(domain\.com)$');
> 
> I didn't see a "*" used in the documentation, so I was curious if that was a valid way to accomplish my goal.  Also, since "thing" is by itself, would the "*" after that cause it to fail?

This should be a Perl regexp, which means that * is a quantifier and not
a globbing character; read up on Perl regexpes if you want to do much of
anything with them.  The following would probably do what you want:

^((blue|red)-.+|thing)@domain\.com

Paul.

-- 
Paul Hoffman <paul at flo.org>
Systems Librarian
Fenway Libraries Online
c/o Wentworth Institute of Technology
550 Huntington Ave.
Boston, MA 02115
(617) 445-2914
(617) 442-2384 (FLO main number)



More information about the rt-users mailing list