Question

Can somebody tell me what is the difference between "^string" and "string" in varnish when we evaluate with ~ in varnish

both does not evaluate similarly and one more when we add a \ it is again different

eg

~ "^index.php/sting" is different to ~ "^/string"

am totally confused

Can somebody show me a link to a cheat sheet or something

Was it helpful?

Solution

In terms of regex, ^ means the beginning of the string, meaning

^/string will match /string123 but not /application/string

/string will match both /string123 and /application/string

^string will not match /string but will match string/123 or string123

string will match all /string, string, 123string and any thing that contains the word string

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top