View Javadoc

1   package org.paneris.bibliomania.util;
2   
3   import org.melati.util.UnexpectedExceptionException;
4   
5   import org.apache.oro.text.regex.MalformedPatternException;
6   import org.apache.oro.text.regex.Perl5Compiler;
7   import org.apache.oro.text.regex.Perl5Pattern;
8   
9   public class OROUtils {
10  
11    private OROUtils() {}
12  
13    public static final Perl5Compiler perl5Compiler = new Perl5Compiler();
14  
15    public static Perl5Pattern perl5Pattern(String re, int mask) {
16      try {
17        return (Perl5Pattern)perl5Compiler.compile(re, mask);
18      }
19      catch (MalformedPatternException e) {
20        throw new UnexpectedExceptionException(e);
21      }
22    }
23  }