]> granicus.if.org Git - apache/commitdiff
fix regex documentation for mod_lua
authorDaniel Gruno <humbedooh@apache.org>
Sun, 14 Apr 2013 06:47:22 +0000 (06:47 +0000)
committerDaniel Gruno <humbedooh@apache.org>
Sun, 14 Apr 2013 06:47:22 +0000 (06:47 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1467730 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/mod/mod_lua.xml

index 4b662dcb4e8ab4bec0750e81fb133effc97c1dd0..203b9d246745db91dd5a1133a6e1ff1938fa6574 100644 (file)
@@ -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">