int sOptions = getSubsOptions(options); Pattern p = getCompiledPattern(options); StringBuffer sb = new StringBuffer();
/*** * Create a new regular expression matcher instance. * * @param p Project whose ant.regexp.regexpimpl property will be used. * @return the matcher instance * @throws BuildException on error */ public Regexp newRegexp(Project p) throws BuildException { String systemDefault; if (p == null) { systemDefault = System.getProperty(MagicNames.REGEXP_IMPL); } else { systemDefault = p.getProperty(MagicNames.REGEXP_IMPL); } if (systemDefault != null) { return createRegexpInstance(systemDefault); // TODO should we silently catch possible exceptions and try to // load a different implementation? } return new Jdk14RegexpRegexp(); }