Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-re
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvmod-re
Commits
929cf112
Unverified
Commit
929cf112
authored
Apr 01, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Link to varnish-cache documentation for regsub(all)?
parent
b744681c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
vmod_re.vcc
src/vmod_re.vcc
+7
-3
No files found.
src/vmod_re.vcc
View file @
929cf112
...
...
@@ -33,13 +33,17 @@ SYNOPSIS
DESCRIPTION
===========
.. _regsub(): https://varnish-cache.org/docs/trunk/reference/vcl.html#regsub-str-regex-sub
.. _regsuball(): https://varnish-cache.org/docs/trunk/reference/vcl.html#regsuball-str-regex-sub
Varnish Module (VMOD) for matching strings against regular expressions,
and for extracting captured substrings after matches.
Regular expression matching as implemented by the VMOD is equivalent
to VCL's infix operator ``~``. The VMOD is motivated by the fact that
backreference capture in standard VCL requires verbose and suboptimal
use of the `
`regsub`` or ``regsuball``
functions. For example, this
use of the `
regsub()`_ or `regsuball()`_
functions. For example, this
common idiom in VCL captures a string of digits following the
substring ``"bar"`` from one request header into another::
...
...
@@ -219,7 +223,7 @@ Description
scope (client or backend context), or a fallback string in
case the extraction fails. Backref 0 indicates the entire
matched string. Thus this function behaves like the ``\n``
symbols in `
`regsub`` and ``regsuball``
, and the ``$1``,
symbols in `
regsub()`_ and `regsuball()`_
, and the ``$1``,
``$2`` ... variables in Perl.
After unsuccessful matches, the ``fallback`` string is returned
...
...
@@ -227,7 +231,7 @@ Description
is ``"**BACKREF METHOD FAILED**"``.
The VCL infix operators ``~`` and ``!~`` do not affect this
method, nor do the functions `
`regsub`` or ``regsuball``
.
method, nor do the functions `
regsub()`_ or `regsuball()`_
.
If ``backref`` is called without any prior call to ``match``
for this object in the same task scope, then an error message
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment