protected String replace(String nodeSource, ShaderNodeVariable var, String newName) {
        nodeSource = nodeSource.replaceAll("(?<=\\W)" + var.getName() + "(?=\\W)",  newName);
        return nodeSource;
    }
replaced a variable name in a source code with the given name
@param nodeSource the source to use
@param var the variable
@param newName the new name of the variable
@return the modified source code
jme3-core/src/main/java/com/jme3/shader/Glsl100ShaderGenerator.java