From fd5d95a5d32351e8e3154aea25d712e986517071 Mon Sep 17 00:00:00 2001 From: Daniel Gruno Date: Sun, 14 Apr 2013 06:47:22 +0000 Subject: [PATCH] fix regex documentation for mod_lua git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1467730 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/mod/mod_lua.xml | 11 +++++++++-- 1 file 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 -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 -- 2.50.1