On Thu, Jun 07, 2001 at 05:01:16PM -0400, Greg Marr wrote:
> At 04:17 PM 06/07/2001, Bill Stoddard wrote:
> >Is there a quick way I can check a string to see if it is a regex or
> >not? I am looking at extending SetEnvIf to accept a regex on the
> >'header' argument (value may already be a regex).
>
> The absolute easiest would be to require that the regex start and end
> with a /.
> SetEnvIf nonregexheader
> SetEnvIf /regexheader/
>
> You could also use a regex on it:
> /^[-A-Za-z0-9_]*$/
> This assumes that only letters, numbers, -, and _ are allowed in
> header names.
Strictly speaking, every string is a regex. It is just that "abc" doesn't
say a whole lot :-)
I like Greg Marr's suggestion of requiring /regex/. That also helps to
clarify things for the user who is reading .conf.
Cheers,
-g
--
Greg Stein, http://www.lyra.org/