I am trying to create a snippet for VS Code that creates a label based on the "Section" name:
"Headings | Section": {
"prefix": "sec",
"body": [
"\\section{${1:section_name}} % (fold)",
"\t\\label{sec:${2:${1/([^a-zA-Z0-9]+)/_/g}}}",
"\t$0"
],
"description": "Create a new section with an automatically generated label"
},
All is working fine to remove non alphanumerical characters and replace spaces with underscores, but I am trying (and currently unable) to also make the label lowercase (\downcase). Would be grateful for any assistances.
I have tried implementing variations such as:
"\t\\label{sec:${2:${1/([^a-zA-Z0-9]+)/_/g}${1/(.)/${1:/downcase}/g}}}",
For the label and not getting the desired result.