procmail
[Top] [All Lists]

Re: How do I match on a phone number?

2001-03-30 12:56:29
Jay asked,

| Ie. I want to match
| (800) 555-1212
| for example. Doesn't () have a special meaning?

Yes; parentheses are for grouping, and sometimes we use an empty pair just
to keep another character from special treatment or mistreatment that it
would get by being first or last.

To match a literal parenthesis, escape it with a backslash (or, less
efficiently, enclose it in brackets):

  \(800\) 555-1212

Note that right parentheses are special even when no left parenthesis has
preceded, so while this would be correct for matching literal brackets
(because right brackets are special only when a left bracket is pending):

  \[800] 555-1212

this is a syntax error:

  \(800) 555-1212

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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