According to documentation we can use replace_regex() to make complex replace in strings. I want to change first letter in json-field key to lower case. This is how my code looks like
let example = @'{"Id":"00000","Categories":[{"Position":208, "CategoryId":"XXX"}]}';
print(replace("\"([^\"]+?)\"\\s*:", @'\l\1', example))
It does not work because I cant' do anything meaningful in replacement pattern.
replace("\"([^\"]+?)\"\\s*:", tolower(@'\0'), example)
or
replace("\"([^\"]+?)\"\\s*:", (@'tolower(\0)'), example)
don't work either.
rewrite: The replacement regex for any match made by matchingRegex. Use \0 to refer to the whole match, \1 for the first capture group, \2 and so on for subsequent capture groups.
Can we use matches (\0, \1, \2) more than just concatenating as in example?