Class RegularExpression

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class RegularExpression
    extends DataType
    A regular expression datatype. Keeps an instance of the compiled expression for speed purposes. This compiled expression is lazily evaluated (it is compiled the first time it is needed). The syntax is the dependent on which regular expression type you are using. The system property "ant.regexp.regexpimpl" will be the classname of the implementation that will be used.
     Available implementations:
    
       org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp (default)
            Based on the JDK's built-in regular expression package
    
       org.apache.tools.ant.util.regexp.JakartaOroRegexp
            Based on the jakarta-oro package
    
       org.apache.tools.ant.util.regexp.JakartaRegexpRegexp
            Based on the jakarta-regexp package
     
       <regexp [ [id="id"] pattern="expression" | refid="id" ]
       />
     
    See Also:
    Perl5Compiler, RE, Pattern, Regexp
    • Field Detail

      • DATA_TYPE_NAME

        public static final java.lang.String DATA_TYPE_NAME
        Name of this data type
        See Also:
        Constant Field Values
    • Constructor Detail

      • RegularExpression

        public RegularExpression()
    • Method Detail

      • setPattern

        public void setPattern​(java.lang.String pattern)
        sets the regular expression pattern
        Parameters:
        pattern - regular expression pattern
      • getPattern

        public java.lang.String getPattern​(Project p)
        Gets the pattern string for this RegularExpression in the given project.
        Parameters:
        p - project
        Returns:
        pattern
      • getRegexp

        public Regexp getRegexp​(Project p)
        provides a reference to the Regexp contained in this
        Parameters:
        p - project
        Returns:
        Regexp instance associated with this RegularExpression instance
      • getRef

        public RegularExpression getRef​(Project p)
        Get the RegularExpression this reference refers to in the given project. Check for circular references too
        Parameters:
        p - project
        Returns:
        resolved RegularExpression instance