Package org.apache.oro.text.regex

This package used to be the OROMatcher library and provides both generic regular expression interfaces and Perl5 regular expression compatible implementation classes.

Interface Summary

MatchResult The MatchResult interface allows PatternMatcher implementors to return results storing match information in whatever format they like, while presenting a consistent way of accessing that information.
Pattern The Pattern interface allows multiple representations of a regular expression to be defined.
PatternCompiler The PatternCompiler interface defines the operations a regular expression compiler must implement.
PatternMatcher The PatternMatcher interface defines the operations a regular expression matcher must implement.
Substitution The Substitution interface provides a means for you to control how a substitution is performed when using the Util.substitute method.

Class Summary

MalformedPatternException A class used to signify the occurrence of a syntax error in a regular expression that is being compiled.
PatternMatcherInput The PatternMatcherInput class is used to preserve state across calls to the contains() methods of PatternMatcher instances.
Perl5Compiler The Perl5Compiler class is used to create compiled regular expressions conforming to the Perl5 regular expression syntax.
Perl5Debug The Perl5Debug class is not intended for general use and should not be instantiated, but is provided because some users may find the output of its single method to be useful.
Perl5Matcher The Perl5Matcher class is used to match regular expressions (conforming to the Perl5 regular expression syntax) generated by Perl5Compiler.
Perl5Pattern An implementation of the Pattern interface for Perl5 regular expressions.
Perl5Substitution Perl5Substitution implements a Substitution consisting of a literal string, but allowing Perl5 variable interpolation referencing saved groups in a match.
StringSubstitution StringSubstitution implements a Substitution consisting of a simple literal string.
Util The Util class is a holder for useful static utility methods that can be generically applied to Pattern and PatternMatcher instances.
This package used to be the OROMatcher library and provides both generic regular expression interfaces and Perl5 regular expression compatible implementation classes.

Note: The following information will be moved into the user's guide.

Perl5 regular expressions

Here we summarize the syntax of Perl5.003 regular expressions, all of which is supported by the Perl5 classes in this package. However, for a definitive reference, you should consult the perlre man page that accompanies the Perl5 distribution and also the book Programming Perl, 2nd Edition from O'Reilly & Associates. We are working toward implementing the features added after Perl5.003 up to and including Perl 5.6. Please remember, we only guarantee support for Perl5.003 expressions in version 2.0.

  • Special backslashed characters
  • Expressions within parentheses are matched as subpattern groups and saved for use by certain methods.

    By default, a quantified subpattern is greedy . In other words it matches as many times as possible without causing the rest of the pattern not to match. To change the quantifiers to match the minimum number of times possible, without causing the rest of the pattern not to match, you may use a "?" right after the quantifier.

    Perl5 extended regular expressions are fully supported.


  • Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.