final Platform platform = Configuration.getPlatform();
final CharSequence regex = ((StringLiteral)this.regex).getStringValue();
final CharSequence flagstr = ((StringLiteral)flags).getStringValue();
final int xmlVersion = visitor.getConfiguration().getXMLVersion();
int flagBits = JRegularExpression.setFlags(flagstr);
pattern = new JRegularExpression(regex, xmlVersion, RegularExpression.XPATH_SYNTAX, flagBits);
if (pattern.matches("")) {
// prevent it being reported more than once
pattern = new JRegularExpression("x", xmlVersion, RegularExpression.XPATH_SYNTAX, flagBits);
invalidRegex("The regular expression must not be one that matches a zero-length string", "XTDE1150");
}
} catch (XPathException err) {
if ("XTDE1150".equals(err.getErrorCodeLocalPart())) {
throw err;