[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: validation function
- From: Antero Vipunen <antero@...>
- Date: Fri, 26 Aug 2005 09:22:38 +0700
Aaron Brown wrote:
I follow `escape magic characters everywhere' convention (even if it is
Normally the percent sign ("%") is necessary to escape magic
characters such as the dot (".") inside patterns, but here
it's not, because we're inside square brackets. (The
percent sign would still be necessary to escape itself,
though, because even inside square brackets it has a special
meaning of introducing character classes such as "%a".)
For example: the pattern "." matches any single character,
the pattern "%." matches a single dot, the pattern "[.,]"
matches a single dot or comma, and the pattern "[.%%]"
matches a single dot or percent sign.