silverbullet icon indicating copy to clipboard operation
silverbullet copied to clipboard

Lua: Pattern group matching variables not expanded in string functions

Open mjf opened this issue 10 months ago • 1 comments

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

mjf avatar Feb 28 '25 13:02 mjf