I want to create a snippet on Visual Studio Code 1.33.1 that create a C++ class using the file's name.
First, I want to set up the "include guard", the point is to use the file's name, replace every '.' by a '_' and set it all to uppercase (norm):
#ifndef FILE_CLASS_HPP //filename: File.class.hpp
The VSC documentation provides some variable for the file's name, and some Regex to change to all uppercase and replace a character by another.
Point is: I never managed to do both since I know nothing about Regex.
I tried to manually join the Regex but it never worked:
#ifndef ${TM_FILENAME/(.*)/${1:/upcase}/[\\.-]/_/g}
expected result:
#ifndef FILE_CLASS_HPP
actual result:
#ifndef ${TM_FILENAME/(.*)//upcase/[\.-]/_/g}