if (matchStart != startx)
{
String prefix = text.substring(startx, matchStart);
_tokens.add(new TextToken(prefix, _textStartLocation));
}
// Group 1 includes the real text of the expansion, which whitespace around the
// expression (but inside the curly
// braces) excluded.
String expression = matcher.group(1);
_tokens.add(new ExpansionToken(expression, _textStartLocation));
startx = matcher.end();
}
// Catch anything after the final regexp match.
if (startx < text.length())
_tokens.add(new TextToken(text.substring(startx, text.length()), _textStartLocation));
}