Binds a patten to the default action.
Binds a patten to the default action, providing options to be
used to compile the pattern.
Registers a pattern action pair, providing options to be used to
compile the pattern.
Registers a pattern action pair.
Adds a value to the cache.
Adds a value to the cache.
Adds a value to the cache.
Adds a value to the cache.
Same as calling
addPattern(expression, 0);
Adds a pattern to the cache and returns the compiled pattern.
Adds a pattern to the cache and returns the compiled pattern.
Adds a pattern to the cache and returns the compiled pattern.
Appends the substitution to a buffer containing the original input
with substitutions applied for the pattern matches found so far.
Appends the substitution to a buffer containing the original input
with substitutions applied for the pattern matches found so far.
Appends the substitution to a buffer containing the original input
with substitutions applied for the pattern matches found so far.
The AwkCompiler class is used to create compiled regular expressions
conforming to the Awk regular expression syntax.
AwkFilenameFilter is a RegexFilenameFilter subclass that filters on Awk
regular expressions as implemented by the org.apache.oro.text.awk package,
which is required to use this class.
Same as AwkFilenameFilter("");
Same as AwkFilenameFilter(regex, AwkCompiler.DEFAULT_MASK);
Construct a filter initialized with the indicated regular expression
and accompanying compilation options conforming to those used by
org.apache.oro.text.awk.AwkCompiler
The AwkMatcher class is used to match regular expressions
(conforming to the Awk regular expression syntax) generated by
AwkCompiler.
An implementation of the Pattern interface for Awk regular expressions.
The AwkStreamInput class is used to look for pattern matches in an
input stream (actually a java.io.Reader instance) in conjunction with
the AwkMatcher class.
Creates an AwkStreamInput instance bound to a Reader with an
initial buffer size and default buffer increment of 2048 bytes.
Creates an AwkStreamInput instance bound to a Reader with a
specified initial buffer size and default buffer increment.
An interface defining the basic functions of a cache.
This class is a GenericCache subclass implementing a FIFO (First
In First Out) cache replacement policy.
Same as:
CacheFIFO(GenericCache.DEFAULT_CAPACITY);
Creates a CacheFIFO instance with a given cache capacity.
This class is a GenericCache subclass implementing a second
chance FIFO (First In First Out) cache replacement policy.
Same as:
CacheFIFO2(GenericCache.DEFAULT_CAPACITY);
Creates a CacheFIFO2 instance with a given cache capacity.
This class is a GenericCache subclass implementing an LRU
(Least Recently Used) cache replacement policy.
Same as:
CacheLRU(GenericCache.DEFAULT_CAPACITY);
Creates a CacheLRU instance with a given cache capacity.
This class is a GenericCache subclass implementing a random
cache replacement policy.
Same as:
CacheRandom(GenericCache.DEFAULT_CAPACITY);
Creates a CacheRandom instance with a given cache capacity.
Returns the maximum number of elements that can be cached at one time.
Returns the maximum number of elements that can be cached at one time.
Returns the maximum number of patterns that can be cached at one time.
Returns the maximum number of patterns that can be cached at one time.
A mask passed as an option to the compile
methods
to indicate a compiled regular expression should be case insensitive.
A mask passed as an option to the compile
methods
to indicate a compiled glob expression should be case insensitive.
A mask passed as an option to the compile
methods
to indicate a compiled regular expression should be case insensitive.
Returns the character at a particular offset relative to the begin
offset of the input.
The char[] representation of the matching line with the trailing
newline truncated.
Same as calling
compile(pattern, AwkCompiler.DEFAULT_MASK);
Same as calling
compile(pattern, GlobCompiler.DEFAULT_MASK);
Compiles a regular expression into a data structure that can be used
by a PatternMatcher implementation to perform pattern matching.
Same as calling
compile(pattern, Perl5Compiler.DEFAULT_MASK);
Compiles an Awk regular expression into an AwkPattern instance that
can be used by an AwkMatcher object to perform pattern matching.
Compiles a Glob expression into a Perl5Pattern instance that
can be used by a Perl5Matcher object to perform pattern matching.
Compiles a regular expression into a data structure that can be
used by a PatternMatcher implementation to perform pattern matching.
Compiles a Perl5 regular expression into a Perl5Pattern instance that
can be used by a Perl5Matcher object to perform pattern matching.
Same as calling
compile(pattern, AwkCompiler.DEFAULT_MASK);
Same as calling
compile(pattern, GlobCompiler.DEFAULT_MASK);
Compiles a regular expression into a data structure that can be used
by a PatternMatcher implementation to perform pattern matching.
Same as calling
compile(pattern, Perl5Compiler.DEFAULT_MASK);
Compiles an Awk regular expression into an AwkPattern instance that
can be used by an AwkMatcher object to perform pattern matching.
Compiles a Glob expression into a Perl5Pattern instance that
can be used by a Perl5Matcher object to perform pattern matching.
Compiles a regular expression into a data structure that can be
used by a PatternMatcher implementation to perform pattern matching.
Compiles a Perl5 regular expression into a Perl5Pattern instance that
can be used by a Perl5Matcher object to perform pattern matching.
Determines if a string (represented as a char[]) contains a pattern.
Determines if a string (represented as a char[]) contains a pattern.
Determines if a string (represented as a char[]) contains a pattern.
Determines if the contents of an AwkStreamInput, starting from the
current offset of the input contains a pattern.
Determines if the contents of a PatternMatcherInput, starting from the
current offset of the input contains a pattern.
Determines if the contents of a PatternMatcherInput, starting from the
current offset of the input contains a pattern.
Determines if the contents of a PatternMatcherInput, starting from the
current offset of the input contains a pattern.
Determines if a string contains a pattern.
Determines if a string contains a pattern.
Determines if a string contains a pattern.
Returns the end offset of the subgroup of the last match found
relative the beginning of the match.
Returns an offset marking the end of the pattern match
relative to the beginning of the input from which the match was
extracted.
Returns an offset marking the end of the last pattern match found
relative to the beginning of the input from which the match was
extracted.
Returns whether or not the end of the input has been reached.
A mask passed as an option to the compile
methods
to indicate a compiled regular expression should be treated as a Perl5
extended pattern (i.e., a pattern using the /x modifier).
This is the base class for all cache implementations provided in the
org.apache.oro.util package.
This is the base class for all cache implementations provided in the
org.apache.oro.text package.
Retrieves the char[] buffer to be used used as input by PatternMatcher
implementations to look for matches.
Retrieves the original input used to initialize the PatternMatcherInput
instance.
Fetches the last match found by a call to a matches() or contains()
method.
Fetches the last match found by a call to a matches() or contains()
method.
Fetches the last match found by a call to a matches() or contains()
method.
Returns the last match found by a call to a match(), substitute(), or
split() method.
Returns the offset marking the beginning of the match found by
contains().
Returns the offset marking the end of the match found by contains().
This method returns an integer containing the compilation options used
to compile this pattern.
This method returns an integer containing the compilation options used
to compile this pattern.
This method returns an integer containing the compilation options used
to compile this pattern.
This method returns the string representation of the pattern.
This method returns the string representation of the pattern.
This method returns the string representation of the pattern.
Same as calling
getPattern(expression, 0)
This method fetches a pattern from the cache.
This method fetches a pattern from the cache.
This method fetches a pattern from the cache.
Returns the string substitution represented by this object.
The GlobCompiler class will compile a glob expression into a Perl5Pattern
that may be used to match patterns in conjunction with Perl5Matcher.
The default GlobCompiler constructor.
GlobFilenameFilter is a RegexFilenameFilter subclass that filters on Glob
regular expressions as implemented by the org.apache.oro.text package,
which is required to use this class.
Same as GlobFilenameFilter("");
Same as GlobFilenameFilter(regex, GlobCompiler.DEFAULT_MASK);
Construct a filter initialized with the indicated regular expression
and accompanying compilation options conforming to those used by
org.apache.oro.text.GlobCompiler
This static method is the basic engine of the Glob PatternCompiler
implementation.
Returns the contents of the parenthesized subgroups of a match,
counting parentheses from left to right and starting from 1.
Returns the contents of the parenthesized subgroups of the last match
found according to the behavior dictated by the MatchResult interface.
An exception used to indicate errors in a regular expression fetched
from a PatternCache.
Simply calls the corresponding constructor of its superclass.
Simply calls the corresponding constructor of its superclass.
A class used to signify the occurrence of a syntax error in a
regular expression that is being compiled.
Simply calls the corresponding constructor of its superclass.
Simply calls the corresponding constructor of its superclass.
An exception used to indicate errors in Perl style regular expressions.
Simply calls the corresponding constructor of its superclass.
Simply calls the corresponding constructor of its superclass.
The first match found in the line of input.
A convenience method returning the part of the input corresponding
to the last match found by a call to a Perl5Matcher
contains
method.
Searches for the first pattern match somewhere in a character array
taking a pattern specified in Perl5 native format:
[m]/pattern/[i][m][s][x]
The
m
prefix is optional and the meaning of the optional
trailing options are:
- i
- case insensitive match
- m
- treat the input as consisting of multiple lines
- s
- treat the input as consisting of a single line
- x
- enable extended expression syntax incorporating whitespace
and comments
As with Perl, any non-alphanumeric character can be used in lieu of
the slashes.
Searches for the next pattern match somewhere in a
org.apache.oro.text.regex.PatternMatcherInput instance, taking
a pattern specified in Perl5 native format:
[m]/pattern/[i][m][s][x]
The
m
prefix is optional and the meaning of the optional
trailing options are:
- i
- case insensitive match
- m
- treat the input as consisting of multiple lines
- s
- treat the input as consisting of a single line
- x
- enable extended expression syntax incorporating whitespace
and comments
As with Perl, any non-alphanumeric character can be used in lieu of
the slashes.
Searches for the first pattern match in a String taking
a pattern specified in Perl5 native format:
[m]/pattern/[i][m][s][x]
The
m
prefix is optional and the meaning of the optional
trailing options are:
- i
- case insensitive match
- m
- treat the input as consisting of multiple lines
- s
- treat the input as consisting of a single line
- x
- enable extended expression syntax incorporating whitespace
and comments
As with Perl, any non-alphanumeric character can be used in lieu of
the slashes.
The MatchAction interface provides the callback interface for actions
bound to patterns in
MatchActionProcessor
.
This class is used to provide information regarding a match found by
MatchActionProcessor to a MatchAction callback implementation.
The MatchActionProcessor class provides AWK-like line by line filtering
of a text stream, pattern action pair association, and field splitting
based on a registered separator.
Default constructor for MatchActionProcessor.
Creates a new MatchActionProcessor instance initialized with the specified
pattern compiler and matcher.
The PatternMatcher used to find the match.
Determines if a string (represented as a char[]) exactly
matches a given pattern.
Determines if a string (represented as a char[]) exactly matches
a given pattern.
Determines if a string (represented as a char[]) exactly
matches a given pattern.
Determines if the contents of a PatternMatcherInput instance
exactly matches a given pattern.
Determines if the contents of a PatternMatcherInput instance
exactly matches a given pattern.
Determines if the contents of a PatternMatcherInput instance
exactly matches a given pattern.
Determines if a string exactly matches a given pattern.
Determines if a string exactly matches a given pattern.
Determines if a string exactly matches a given pattern.
Determines if a prefix of a string (represented as a char[])
matches a given pattern.
Determines if a prefix of a string (represented as a char[])
matches a given pattern.
Determines if a prefix of a string (represented as a char[])
matches a given pattern.
Determines if a prefix of a string (represented as a char[])
matches a given pattern, starting from a given offset into the string.
Determines if a prefix of a string (represented as a char[])
matches a given pattern, starting from a given offset into the string.
Determines if a prefix of a string (represented as a char[])
matches a given pattern, starting from a given offset into the string.
Determines if a prefix of a PatternMatcherInput instance
matches a given pattern.
Determines if a prefix of a PatternMatcherInput instance
matches a given pattern.
Determines if a prefix of a PatternMatcherInput instance
matches a given pattern.
Determines if a prefix of a string matches a given pattern.
Determines if a prefix of a string matches a given pattern.
Determines if a prefix of a string matches a given pattern.
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.
A mask passed as an option to the compile
methods
to indicate a compiled regular expression should treat input as having
multiple lines.
A mask passed as an option to the compile
methods
to indicate a compiled regular expression should treat input as having
multiple lines.
This package provides FilenameFilters that filter based on a regular
expression and other I/O-related classes that derive their
functionality from regular expressions.
This package used to be the TextTools library and provides general
text processing support, including a glob regular expression class,
pattern caching and line-by-line processing classes.
This package used to be the AwkTools library and provides AWK-like
regular expression classes that implement the
org.apache.oro.text.regex
interfaces.
This package used to be the PerlTools library and adds Perl5
regular expression syntactic sugar built on top of the
org.apache.oro.text.regex
Perl5 regular expression classes.
This package used to be the OROMatcher library and provides both
generic regular expression interfaces and Perl5 regular expression
compatible implementation classes.
This package includes general classes required by org.apache.oro.text
and related packages, but that can also be applied to
more general uses.
The output stream passed to the MatchActionProcessor.
The pattern found in the line of input.
The Pattern interface allows multiple representations of a regular
expression to be defined.
An interface defining the basic functions of a regular expression
cache.
This class is a GenericPatternCache subclass implementing a FIFO (First
In First Out) cache replacement policy.
Same as:
PatternCacheFIFO(GenericPatternCache.DEFAULT_CAPACITY);
Same as:
PatternCacheFIFO(capacity, new Perl5Compiler());
Creates a PatternCacheFIFO instance with a given cache capacity,
initialized to use a given PatternCompiler instance as a pattern compiler.
Same as:
PatternCacheFIFO(GenericPatternCache.DEFAULT_CAPACITY, compiler);
This class is a GenericPatternCache subclass implementing a second
chance FIFO (First In First Out) cache replacement policy.
Same as:
PatternCacheFIFO2(GenericPatternCache.DEFAULT_CAPACITY);
Same as:
PatternCacheFIFO2(capacity, new Perl5Compiler());
Creates a PatternCacheFIFO2 instance with a given cache capacity,
initialized to use a given PatternCompiler instance as a pattern compiler.
Same as:
PatternCacheFIFO2(GenericPatternCache.DEFAULT_CAPACITY, compiler);
This class is a GenericPatternCache subclass implementing an LRU
(Least Recently Used) cache replacement policy.
Same as:
PatternCacheLRU(GenericPatternCache.DEFAULT_CAPACITY);
Same as:
PatternCacheLRU(capacity, new Perl5Compiler());
Creates a PatternCacheLRU instance with a given cache capacity,
and initialized to use a given PatternCompiler instance as a pattern
compiler.
Same as:
PatternCacheLRU(GenericPatternCache.DEFAULT_CAPACITY, compiler);
This class is a GenericPatternCache subclass implementing a random
cache replacement policy.
Same as:
PatternCacheRandom(GenericPatternCache.DEFAULT_CAPACITY);
Same as:
PatternCacheRandom(capacity, new Perl5Compiler());
Creates a PatternCacheRandom instance with a given cache capacity
and initialized to use a given PatternCompiler instance as a pattern
compiler.
Same as:
PatternCacheRandom(GenericPatternCache.DEFAULT_CAPACITY, compiler);
The PatternCompiler interface defines the operations a regular
expression compiler must implement.
The PatternMatcher interface defines the operations a regular
expression matcher must implement.
The PatternMatcherInput class is used to preserve state across
calls to the contains()
methods of PatternMatcher instances.
Like calling:
PatternMatcherInput(input, 0, input.length);
Creates a PatternMatcherInput object, associating a region of a string
(represented as a char[]) as input
to be used for pattern matching by PatternMatcher objects.
Like calling
PatternMatcherInput(input, 0, input.length());
Creates a PatternMatcherInput object, associating a region of a String
as input to be used for pattern matching by PatternMatcher objects.
The Perl5Compiler class is used to create compiled regular expressions
conforming to the Perl5 regular expression syntax.
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.
Perl5FilenameFilter is a RegexFilenameFilter subclass that filters on Perl5
regular expressions as implemented by the org.apache.oro.text.regex package,
which is required to use this class.
Same as Perl5FilenameFilter("");
Same as Perl5FilenameFilter(regex, Perl5Compiler.DEFAULT_MASK);
Construct a filter initialized with the indicated regular expression
and accompanying compilation options conforming to those used by
org.apache.oro.text.regex.Perl5Compiler
The Perl5Matcher class is used to match regular expressions
(conforming to the Perl5 regular expression syntax) generated by
Perl5Compiler.
An implementation of the Pattern interface for Perl5 regular expressions.
Perl5Substitution implements a Substitution consisting of a
literal string, but allowing Perl5 variable interpolation referencing
saved groups in a match.
Default constructor initializing substitution to a zero length
String and the number of interpolations to
INTERPOLATE_ALL
.
Creates a Perl5Substitution using the specified substitution
and setting the number of interpolations to
INTERPOLATE_ALL
.
Creates a Perl5Substitution using the specified substitution
and setting the number of interpolations to the specified value.
This is a utility class implementing the 3 most common Perl5 operations
involving regular expressions:
- [m]/pattern/[i][m][s][x],
- s/pattern/replacement/[g][i][m][o][s][x],
- and split().
Default constructor for Perl5Util.
A secondary constructor for Perl5Util.
A convenience method returning the part of the input occurring after
the last match found by a call to a Perl5Matcher
contains
method.
Returns the part of the input following the last match found.
Returns the part of the input following the last match found as a char
array.
A convenience method returning the part of the input occurring before
the last match found by a call to a Perl5Matcher
contains
method.
Returns the part of the input preceding the last match found.
Returns the part of the input preceding the last match found as a
char array.
This method prints to a String the bytecode program contained in a
Perl5Pattern._ The program byte codes are identical to those
generated by Perl5 with the -r option, but the offsets are
different due to the different data structures used.
This method is called by MatchActionProcessor when it finds an associated
pattern in a line of input.
This method reads the provided input one line at a time using the
platform standart character encoding and for every registered
pattern that is contained in the line it executes the associated
MatchAction's processMatch() method.
This method reads the provided input one line at a time and for
every registered pattern that is contained in the line it executes
the associated MatchAction's processMatch() method.
This method reads the provided input one line at a time and for
every registered pattern that is contained in the line it executes
the associated MatchAction's processMatch() method.
A mask passed as an option to the compile
methods
to indicate that the resulting Perl5Pattern should be treated as a
read only data structure by Perl5Matcher, making it safe to share
a single Perl5Pattern instance among multiple threads without needing
synchronization.
A mask passed as an option to the compile
methods
to indicate that the resulting Perl5Pattern should be treated as a
read only data structure by Perl5Matcher, making it safe to share
a single Perl5Pattern instance among multiple threads without needing
synchronization.
RegexFilenameFilter is the base class for a set of FilenameFilter
implementations that filter based on a regular expression.
Sets the offset of the input that should be considered the start
of the region to be considered as input by PatternMatcher
methods.
Sets the offset of the input that should be considered the current
offset where PatternMatcher methods should start looking for
matches.
Sets the offset of the input that should be considered the end
of the region to be considered as input by PatternMatcher
methods.
Sets the field separator to use when splitting a line into fields.
Sets the field separator to use when splitting a line into fields.
Set the regular expression on which to filter.
Set the regular expression on which to filter along with any
special options to use when compiling the expression.
This method is identical to calling:
setInput(input, 0, input.length);
Associates a region of a string (represented as a char[]) as input
to be used for pattern matching by PatternMatcher objects.
This method is identical to calling:
setInput(input, 0, input.length());
Associates a region of a String as input
to be used for pattern matching by PatternMatcher objects.
This method is intended for use by PatternMatcher implementations.
Set whether or not subsequent calls to matches()
or contains()
should treat the input as
consisting of multiple lines.
Sets the substitution represented by this Perl5Substitution, also
setting the number of interpolations to
INTERPOLATE_ALL
.
Sets the substitution represented by this StringSubstitution.
Sets the substitution represented by this Perl5Substitution, also
setting the number of interpolations to the specified value.
A mask passed as an option to the compile
methods
to indicate a compiled regular expression should treat input as being
a single line.
Returns the number of elements in the cache, not to be confused with
the
capacity()
which returns the number
of elements that can be held in the cache at one time.
Returns the number of elements in the cache, not to be confused with
the
capacity()
which returns the number
of elements that can be held in the cache at one time.
Returns the number of elements in the cache, not to be confused with
the
capacity()
which returns the number
of elements that can be held in the cache at one time.
Returns the number of elements in the cache, not to be confused with
the
capacity()
which returns the number
of elements that can be held in the cache at one time.
Splits up a String
instance and stores results as a
Collection
of all its substrings using a regular expression
as the delimiter.
Splits up a String
instance and stores results as a
List
of substrings numbering no more than a specified
limit.
Splits input in the default Perl manner, splitting on all whitespace.
This method is identical to calling:
split(results, pattern, input, SPLIT_ALL);
Splits a String into strings that are appended to a List, but no more
than a specified limit.
Splits up a String
instance into a Vector
of all its substrings using a regular expression as the delimiter.
Splits up a String
instance into strings contained in a
Vector
of size not greater than a specified limit.
Splits input in the default Perl manner, splitting on all whitespace.
This method is identical to calling:
split(pattern, input, SPLIT_ALL);
split(Collection results, String pattern, String input)
instead.
Splits a String into strings contained in a Vector of size no greater
than a specified limit.
A constant passed to the split()
methods indicating
that all occurrences of a pattern should be used to split a string.
A constant passed to the split()
methods
indicating that all occurrences of a pattern should be used to
split a string.
A mask passed as an option to the compile
methods
to indicate that a * should not be allowed to match the null string.
StringSubstitution implements a Substitution consisting of a simple
literal string.
Default constructor initializing substitution to a zero length
String.
Creates a StringSubstitution representing the given string.
Searches a string for a pattern and substitutes only the first
occurence of the pattern.
Searches a string for a pattern and replaces the first occurrences
of the pattern with a Substitution up to the number of
substitutions specified by the numSubs parameter.
Substitutes a pattern in a given input with a replacement string.
Searches a string for a pattern and replaces the first occurrences
of the pattern with a Substitution up to the number of
substitutions specified by the numSubs parameter.
Searches a string for a pattern and replaces the first occurrences
of the pattern with a Substitution up to the number of
substitutions specified by the numSubs parameter.
Substitutes a pattern in a given input with a replacement string.
A constant passed to the substitute()
methods indicating that all occurrences of a pattern should be
substituted.
The Substitution interface provides a means for you to control how
a substitution is performed when using the
Util.substitute
method.
Returns a new string that is a substring of the PatternMatcherInput
instance.
Returns a new string that is a substring of the PatternMatcherInput
instance.