public Regex not() {
      if (this.pattern.length() > 0) {
         if (this.pattern.charAt(0) == '[' && this.pattern.length() > 1) {
            return re("[^" + this.pattern.substring(1));
         }
         return re("^" + this.pattern);
      }
      return this;
   }
public Regex not ( ) { if ( this . pattern . length ( ) > 0 ) { if ( this . pattern . charAt ( 0 ) == '[' && this . pattern . length ( ) > 1 ) { return re ( "[^" + this . pattern . substring ( 1 ) ) ; } return re ( "^" + this . pattern ) ; } return this ; }
Negates the regex

@return the negated regex