logical or statement failing

Geoff Simmons geoff at uplex.de
Mon Aug 17 00:06:53 CEST 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 8/16/15 8:00 PM, Tim Dunphy wrote:
> 
> "^/?\?oa_social_login_source=custom$"
> 
> "^\?oa_social_login_source=custom$"

The '^' anchors the regex at the beginning of the string. So the first
one will match exactly this URL:

	/?oa_social_login_source=custom

Meaning '/' with the query string 'oa_social_login_source=custom'.
Since that didn't work, that's apparently not the URL you wanted.

The second one matches exactly this string:

	?oa_social_login_source=custom

... which can never be a legal URL -- it's just a query string without
a path.

If you're trying to say that the URL should have that key-value pair
in the query string (and may have others), then just do this:

	req.url ~ "oa_social_login_source=custom"

... without either '^' or '$'.

Or if you're trying to say that the query string should be strictly
that key-value pair and nothing else, then:

	req.url ~ "\?oa_social_login_source=custom$"

That is, match from the '?' to end-of-string.


HTH,
Geoff
- -- 
UPLEX Systemoptimierung
Scheffelstraße 32
22301 Hamburg
http://uplex.de/
Mob: +49-176-63690917
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)

iQIcBAEBCAAGBQJV0Ql8AAoJEOUwvh9pJNURwqEP/3OGbztdPC/gFnNM8KlQj+fU
32onqfVD67nUYPwdLhD8Y8kdhi9xebwmVVHsEe8h2yW3Ob+mH4ixm/+s7cbKQTaQ
gTs37/c49BtzRVTfV3jFItcXtIcHvUh9x9dOWfpJ3/ruHfQg2Srbj7OKQr7cgn4l
VmtPUaph329XBCsPUH0j8ByXaFFCpTiTTqhWahUnpvm9GI4KTEh+Dg/vusIOI9e9
z6c6QAylvHnFKBg46ocIqUHT0DzjkxXwt7epES5Lq8MTOAIvN/joCE3GbjkETIwi
LumjzXk83kVgMxqZUMpKNO1jnAqvxidNJPDD7T9cACHGEj3mvF1uyIlvZcnReC5R
PSBbgCBh6ZHtR6AqXbIgJ7cJpoohGBk+Ur9w06ohINq7UoudwjsU/mO6gpvFFCtB
fOP8+VE4nCmUxdF3pO4WQUzeHRm7VKzEkZsYMhqoRjPDaNyWBzJpyLhco0xniMY0
e+hqxxbu18ot5aVxNZPbh0X9x9F5G8CDbbhlBgoMJWaqou+0vnYfRBr6/E0pCazd
+QMYVtiCjLSgz/PIbAZ08ExDtQde6rlRHnWlERMgYwZvrdzY+PidAA8kBWM2lztz
KsJD9f9bRieSxjFjl16Zb/PeOe5bLpAZH+LM5qXRG9AsNO8fms5nSh/UV7BDGgil
NzypSOq96qDWezbCxBzS
=H9au
-----END PGP SIGNATURE-----



More information about the varnish-misc mailing list