public List<String> extractDefines(String expression) {
        List<String> defines = new ArrayList<>();
        expression = expression.replaceAll("#ifdef", "").replaceAll("#if", "").replaceAll("defined", "");
        Pattern pattern = Pattern.compile("(\\w+)");
        formattedExpression = expression;
        Matcher m = pattern.matcher(expression);
        while (m.find()) {
            String match = m.group();
            defines.add(match);
            formattedExpression = formattedExpression.replaceAll("\\b" + match + "\\b", "defined(" + match.toUpperCase() + ")");
        }
        return defines;
    }
Parses a condition and returns the list of defines of this condition.
Additionally, this method updates the formattedExpression with uppercased
defines names.

supported expression syntax example:<br><br>
{@code "(LightMap && SeparateTexCoord) || !ColorMap"}<br><br>
{@code "#if (defined(LightMap) && defined(SeparateTexCoord)) || !defined(ColorMap)"}<br><br>
{@code "#ifdef LightMap"}<br><br>
{@code "#ifdef (LightMap && SeparateTexCoord) || !ColorMap"}<br>

@param expression the expression to parse
@return the list of defines
jme3-core/src/plugins/java/com/jme3/material/plugins/ConditionParser.java