procmail
[Top] [All Lists]

Re: regex double checking

1997-10-20 01:22:27
On Mon, 20 Oct 97 02:39:37 -0400, Timothy J Luoma
<luomat+procmail(_at_)luomat(_dot_)peak(_dot_)org> wrote:
(majordomo|listless|mail(2|3|5|6)?)\.netcom\.com
Do I need the | between the 2356 or can I write it like this:
(majordomo|listless|mail[2356]?)\.netcom\.com

By happy coincindence, both constructs work in this case, where the
alternate strings are one character long. If the distinction between
'one string|another string' and '[ab]' is not clear to you, play
around with egrep. (Or try the "Hip Owls" book -- haven't read it
myself, but I've seen some rave reviews.)

/* era */

Character classes are of course most useful when you really want to
catch a largish range of characters, such as [a-z], or negate the
class, i.e. [^a-z]. 

-- 
 Paparazzi of the Net: No matter what you do to protect your privacy,
  they'll hunt you down and spam you. <http://www.iki.fi/~era/spam/>

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