From: Daniel Gruno Date: Sun, 14 Apr 2013 06:47:22 +0000 (+0000) Subject: fix regex documentation for mod_lua X-Git-Tag: 2.5.0-alpha~5585 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fd5d95a5d32351e8e3154aea25d712e986517071;p=apache fix regex documentation for mod_lua git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1467730 13f79535-47bb-0310-9956-ffa450edef68 --- 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