I'm trying to use a regex transformation in a snippet that will convert the first letter of a word to uppercase and convert underscore _ followed by a letter to a space and an uppercase letter.
eg:
field_name > Field Name long_field_name > Long Field Name
I can't quite get get my head round how to do it, as it seems like two seperate transformations, but I'm not sure how to to do transformations on a string in a snippet.
Is there a collection of regexes for transforming between the main cases? (particularly Camel, Title and underscore seperated) I managed one that went from CamelCase to underscore_seperated:
${1/([a-z0-9])?([A-Z])/(?1:$1_)\l$2/g}
Thanks
Ed