From: Daniel Gruno Date: Sun, 14 Apr 2013 06:47:22 +0000 (+0000) Subject: fix regex documentation for mod_lua X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4bb00a6e2633bc8d4ee09eceaf781882769cc4f8;p=thirdparty%2Fapache%2Fhttpd.git 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 4b662dcb4e8..203b9d24674 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