com.rational.test.util.regex

Class ApacheRegExp

  • java.lang.Object
    • com.rational.test.util.regex.ApacheRegExp
  • All Implemented Interfaces:
    IRegEx


    public class ApacheRegExp
    extends java.lang.Object
    implements IRegEx
    Apache Regular Expression
    • Constructor Summary

      Constructors 
      Constructor and Description
      ApacheRegExp(java.lang.String pattern) 
      ApacheRegExp(java.lang.String pattern, boolean supportMatches) 
      ApacheRegExp(java.lang.String pattern, int matchFlags) 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String getMatch()
      Returns the part of the string that matched the pattern.
      java.lang.String getMatch(int index)
      Returns the substring that matched one of the parenthesized subexpressions of the regular expression.
      int getMatchCount()
      Returns the number of parenthesized subexpressions in the regular expression.
      int getMatchFlags()
      Return the match flags
      boolean matches(java.lang.String stringToCompare)
      Determines whether the regular expression pattern matches the provided string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ApacheRegExp

        public ApacheRegExp(java.lang.String pattern)
      • ApacheRegExp

        public ApacheRegExp(java.lang.String pattern,
                            int matchFlags)
      • ApacheRegExp

        public ApacheRegExp(java.lang.String pattern,
                            boolean supportMatches)
    • Method Detail

      • getMatch

        public java.lang.String getMatch()
        Description copied from interface: IRegEx
        Returns the part of the string that matched the pattern. This is the same as getMatch(0).
        Specified by:
        getMatch in interface IRegEx
      • getMatch

        public java.lang.String getMatch(int index)
        Description copied from interface: IRegEx
        Returns the substring that matched one of the parenthesized subexpressions of the regular expression. The index indicates which substring should be returned. An index of 0 returns the entire matched string, an index of 1 returns the matched substring for the first parenthesized subexpression of the regular expression, etc.
        Specified by:
        getMatch in interface IRegEx
      • getMatchCount

        public int getMatchCount()
        Description copied from interface: IRegEx
        Returns the number of parenthesized subexpressions in the regular expression.
        Specified by:
        getMatchCount in interface IRegEx
      • matches

        public boolean matches(java.lang.String stringToCompare)
        Description copied from interface: IRegEx
        Determines whether the regular expression pattern matches the provided string.
        Specified by:
        matches in interface IRegEx
      • getMatchFlags

        public int getMatchFlags()
        Return the match flags
        Specified by:
        getMatchFlags in interface IRegEx
        Returns: