Commit b0e9f92f authored by Geoff Simmons's avatar Geoff Simmons

Minor doc polish.

parent 0b40f914
......@@ -604,16 +604,21 @@ prior match was case insensitive, and the matched string differs in
case, the string with the case as added to the set is returned.
``.element()`` fails and returns NULL if the rules for ``n`` and
``select`` indicate failure; that is, if ``n`` is out of range
(greater than the number of elements in the set), or if ``n`` < 1 and
``select`` fails for ``UNIQUE`` or ``EXACT``, or ``n`` < 1 and there
was no prior invocation of ``.match()`` or ``.hasprefix()``.
``select`` indicate failure; that is:
* ``n`` is out of range (greater than the number of elements in the
set)
* ``n`` < 1 and ``select`` fails for ``UNIQUE`` or ``EXACT``
* ``n`` < 1 and there was no prior invocation of ``.match()`` or
``.hasprefix()``.
Example::
if (myset.hasprefix(req.url)) {
# Construct a redirect response for another host, using the
# matching prefix in the request URL as the new URL.
# matching prefix in the request URL as the new URL path.
set resp.http.Location = "http://other.com" + myset.element();
}
......
......@@ -520,16 +520,21 @@ prior match was case insensitive, and the matched string differs in
case, the string with the case as added to the set is returned.
``.element()`` fails and returns NULL if the rules for ``n`` and
``select`` indicate failure; that is, if ``n`` is out of range
(greater than the number of elements in the set), or if ``n`` < 1 and
``select`` fails for ``UNIQUE`` or ``EXACT``, or ``n`` < 1 and there
was no prior invocation of ``.match()`` or ``.hasprefix()``.
``select`` indicate failure; that is:
* ``n`` is out of range (greater than the number of elements in the
set)
* ``n`` < 1 and ``select`` fails for ``UNIQUE`` or ``EXACT``
* ``n`` < 1 and there was no prior invocation of ``.match()`` or
``.hasprefix()``.
Example::
if (myset.hasprefix(req.url)) {
# Construct a redirect response for another host, using the
# matching prefix in the request URL as the new URL.
# matching prefix in the request URL as the new URL path.
set resp.http.Location = "http://other.com" + myset.element();
}
......@@ -629,8 +634,8 @@ If ``all`` is ``false``, then return the result of replacing the first
portion of ``str`` that matches the regex with ``sub``. ``sub`` may
contain backreferences ``\0`` through ``\9``, to include captured
substrings from ``str`` in the substitution. This is the same
operation performed by the native VCL function ``regsub(str, regex,
sub)`` (see vcl(7)). By default, ``all`` is false.
operation performed by the native VCL function
``regsub(str, regex, sub)`` (see vcl(7)). By default, ``all`` is false.
If ``all`` is ``true``, return the result of replacing each
non-overlapping portion of ``str`` that matches the regex with ``sub``
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment