title: Extracting variables from SpEL
body: <p>I need to know what all variables are there in an expression.</p>
  
  <p>Consider the following code snippet,</p>
  
  <pre><code>ExpressionParser parser = new SpelExpressionParser();
  EvaluationContext context = new StandardEvaluationContext();
  context.setVariable("a", true);
  context.setVariable("b", true);
  context.setVariable("c", true);
  boolean result = (Boolean) parser.parseExpression("#a AND (#b OR #c)").getValue(context);
  </code></pre>
  
  <p>Does SpEL have a functionality by which I can get all the variables that are there in my expression? Basically, I need something like this,</p>
  
  <pre><code>List&lt;String&gt; allVariables = parser.parseExpression("#a AND (#b OR #c)").getVariables();
  // allVariables -&gt; ["#a", "#b", "#c"]
  </code></pre>
  
  <p>My use case is that I am reading these expressions from a datastore and need to confirm if all the variables in the expression are valid.</p>
  
  <p>Thanks in advance!!</p>