/** * If the regex is set, then only properties whose names match it * will be recorded. If prefix is not set and if this is never set, * or it is set to an empty string or <tt>null</tt>, then all * properties will be recorded. * * <p>For example, if the attribute is set as:</p> * <pre><echoproperties prefix=".*ant.*" /></pre> * then the properties "ant.home" and "user.variant" will be recorded, * but "ant-example" will not. * * @param regex The new regex value * * @since Ant 1.7 */ public void setRegex(String regex) { if (regex != null && !regex.isEmpty()) { this.regex = regex; PropertySet ps = new PropertySet(); ps.setProject(getProject()); ps.appendRegex(regex); addPropertyset(ps); } }