summaryrefslogtreecommitdiffstats
path: root/docs/manual/mod/mod_lua.xml
diff options
context:
space:
mode:
authorDaniel Gruno <humbedooh@apache.org>2013-04-14 08:47:22 +0200
committerDaniel Gruno <humbedooh@apache.org>2013-04-14 08:47:22 +0200
commitfd5d95a5d32351e8e3154aea25d712e986517071 (patch)
tree94296b87a24db3f952c5e624e995f9af41f42101 /docs/manual/mod/mod_lua.xml
parentReturn early with an error instead of returning an incomplete match table. (diff)
downloadapache2-fd5d95a5d32351e8e3154aea25d712e986517071.tar.xz
apache2-fd5d95a5d32351e8e3154aea25d712e986517071.zip
fix regex documentation for mod_lua
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1467730 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'docs/manual/mod/mod_lua.xml')
-rw-r--r--docs/manual/mod/mod_lua.xml11
1 files changed, 9 insertions, 2 deletions
diff --git a/docs/manual/mod/mod_lua.xml b/docs/manual/mod/mod_lua.xml
index 4b662dcb4e..203b9d2467 100644
--- a/docs/manual/mod/mod_lua.xml
+++ b/docs/manual/mod/mod_lua.xml
@@ -864,12 +864,19 @@ end
</highlight>
<highlight language="lua">
-r:regex(string, pattern) -- Runs a regular expression match on a string, returning captures if matched:
+r:regex(string, pattern, [flags]) -- Runs a regular expression match on a string, returning captures if matched:
-local matches = r:regex("foo bar baz", "foo (\w+) (\S*)")
+local matches = r:regex("foo bar baz", [[foo (\w+) (\S*)]])
if matches then
r:puts("The regex matched, and the last word captured ($2) was: " .. matches[2])
end
+
+-- Example ignoring case sensitivity:
+local matches = r:regex("FOO bar BAz", [[(foo) bar]], 1)
+
+-- Flags can be a bitwise combination of:
+-- 0x01: Ignore case
+-- 0x02: Multiline search
</highlight>
<highlight language="lua">