1 package org.jacorb.notification.util; 2 3 22 23 import org.apache.regexp.RESyntaxException; 24 25 29 public class JakartaRegexpPatternWrapper extends PatternWrapper { 30 31 private org.apache.regexp.RE pattern_; 32 33 public void compile(String patternString) { 34 try 35 { 36 pattern_ = new org.apache.regexp.RE( "(" + patternString + ")" ); 37 } 38 catch ( RESyntaxException e ) 39 { 40 throw new RuntimeException ( e.getMessage() ); 41 } 42 } 43 44 45 public int match(String string) { 46 boolean _matched = pattern_.match(string); 47 48 if (!_matched) { 49 return 0; 50 } 51 52 return pattern_.getParenEnd(1); 53 } 54 55 56 public String toString() { 57 return pattern_.toString(); 58 } 59 } 60 | Popular Tags |