Problem with case-insensitive (?i) regex

Tollef Fog Heen tfheen at varnish-software.com
Mon Dec 6 08:34:25 CET 2010


]] Per Buer 

Hi,

| +In Varnish 2.1.0 Varnish switched to using PCRE - Perl-compatible
| +regular expressions. For a complete description of PCRE please see the
| +PCRE(3) man page.

You probably want the pcresyntax(3) or pcrepattern(3) man page.

| +To send flags to the PCRE engine, such as to turn on *case
| +insensitivity* add the flag within parens following a question mark,
| +like this:::
| +
| +  if (req.http.host ~ "(?i)example.com$") {
| +          ...
| +  }

Yup, looks good to me.

-- 
Tollef Fog Heen
Varnish Software
t: +47 21 98 92 64




More information about the varnish-misc mailing list