Skip to content

Instantly share code, notes, and snippets.

@kindy
Created December 8, 2012 03:38
Show Gist options
  • Save kindy/4238479 to your computer and use it in GitHub Desktop.
Save kindy/4238479 to your computer and use it in GitHub Desktop.
# default to '~'
xconf {
echo '[~~[';
echo \[~~[''xx;
content_by_lua [~~[
ngx.say'hello!'
]~~];
}
# the char between [
xconf '!' {
content_by_lua [!![
ngx.say'hello!'
]!!];
}
# if you give 42 as the sep, we will try match like this \[((.)\2*)\[ .*? \]\1\]
xconf 42 {
echo [@@[
ngx.say'hello!'
]@@];
echo [##[
local x = require 'x'
]##];
echo [$$[
ngx.print'abc'
]$$];
echo [%%[
ngx.print'abc'
]%%];
echo [^^[
ngx.print'abc'
]^^];
echo [&&[
ngx.print'abc'
]&&];
echo [**[
ngx.print'abc'
]**];
echo [--[
ngx.print'abc'
]--];
echo [__[
ngx.print'abc'
]__];
echo [++[
ngx.print'abc'
]++];
echo [||[
ngx.print'abc'
]||];
echo [::[
ngx.print'abc'
]::];
echo [??[
ngx.print'abc'
]??];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment