silverbullet
silverbullet copied to clipboard
Lua: Pattern group matching variables not expanded in string functions
I found out the following one:
```space-lua
function toSnakeCase(text)
text = string.gsub(text, "([a-z])([A-Z])", "%1_%2")
return string.lower(text)
end
```
called as:
${toSnakeCase('CamelCase')}
yields:
came%1_%2ase
but subgroup matching variables not expanded. Expected:
camel_case