接口的使用
org.apache.oro.text.regex.Pattern
使用Pattern的程序包
程序包
说明
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 OROMatcher library and provides both
generic regular expression interfaces and Perl5 regular expression
compatible implementation classes.
-
org.apache.oro.text中Pattern的使用
声明为Pattern的org.apache.oro.text中的字段修饰符和类型字段说明MatchActionInfo.fieldSeparatorThe field separator used by the MatchActionProcessor.MatchActionInfo.patternThe pattern found in the line of input.返回Pattern的org.apache.oro.text中的方法修饰符和类型方法说明final PatternGenericPatternCache.addPattern(String expression) Same as callingfinal PatternGenericPatternCache.addPattern(String expression, int options) Adds a pattern to the cache and returns the compiled pattern.PatternCache.addPattern(String expression) Adds a pattern to the cache and returns the compiled pattern.PatternCache.addPattern(String expression, int options) Adds a pattern to the cache and returns the compiled pattern.GlobCompiler.compile(char[] pattern) Same as calling compile(pattern, GlobCompiler.DEFAULT_MASK);GlobCompiler.compile(char[] pattern, int options) Compiles a Glob expression into a Perl5Pattern instance that can be used by a Perl5Matcher object to perform pattern matching.Same as calling compile(pattern, GlobCompiler.DEFAULT_MASK);Compiles a Glob expression into a Perl5Pattern instance that can be used by a Perl5Matcher object to perform pattern matching.final PatternGenericPatternCache.getPattern(String expression) Same as callingfinal PatternGenericPatternCache.getPattern(String expression, int options) This method fetches a pattern from the cache.PatternCache.getPattern(String expression) This method fetches a pattern from the cache.PatternCache.getPattern(String expression, int options) This method fetches a pattern from the cache. -
org.apache.oro.text.awk中Pattern的使用
修饰符和类型类说明final classAn implementation of the Pattern interface for Awk regular expressions.修饰符和类型方法说明AwkCompiler.compile(char[] pattern) Same as calling compile(pattern, AwkCompiler.DEFAULT_MASK);AwkCompiler.compile(char[] pattern, int options) Compiles an Awk regular expression into an AwkPattern instance that can be used by an AwkMatcher object to perform pattern matching.Same as calling compile(pattern, AwkCompiler.DEFAULT_MASK);Compiles an Awk regular expression into an AwkPattern instance that can be used by an AwkMatcher object to perform pattern matching.参数类型为Pattern的org.apache.oro.text.awk中的方法修饰符和类型方法说明booleanDetermines if a string (represented as a char[]) contains a pattern.booleanDetermines if a string contains a pattern.booleanAwkMatcher.contains(AwkStreamInput input, Pattern pattern) Determines if the contents of an AwkStreamInput, starting from the current offset of the input contains a pattern.booleanAwkMatcher.contains(PatternMatcherInput input, Pattern pattern) Determines if the contents of a PatternMatcherInput, starting from the current offset of the input contains a pattern.booleanDetermines if a string (represented as a char[]) exactly matches a given pattern.booleanDetermines if a string exactly matches a given pattern.booleanAwkMatcher.matches(PatternMatcherInput input, Pattern pattern) Determines if the contents of a PatternMatcherInput instance exactly matches a given pattern.booleanAwkMatcher.matchesPrefix(char[] input, Pattern pattern) Determines if a prefix of a string (represented as a char[]) matches a given pattern.booleanAwkMatcher.matchesPrefix(char[] input, Pattern pattern, int offset) Determines if a prefix of a string (represented as a char[]) matches a given pattern, starting from a given offset into the string.booleanAwkMatcher.matchesPrefix(String input, Pattern pattern) Determines if a prefix of a string matches a given pattern.booleanAwkMatcher.matchesPrefix(PatternMatcherInput input, Pattern pattern) Determines if a prefix of a PatternMatcherInput instance matches a given pattern. -
org.apache.oro.text.regex中Pattern的使用
修饰符和类型类说明final classAn implementation of the Pattern interface for Perl5 regular expressions.修饰符和类型方法说明PatternCompiler.compile(char[] pattern) Compiles a regular expression into a data structure that can be used by a PatternMatcher implementation to perform pattern matching.PatternCompiler.compile(char[] pattern, int options) Compiles a regular expression into a data structure that can be used by a PatternMatcher implementation 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 regular expression into a data structure that can be used by a PatternMatcher implementation to perform pattern matching.Perl5Compiler.compile(char[] pattern) Same as calling compile(pattern, Perl5Compiler.DEFAULT_MASK);Perl5Compiler.compile(char[] pattern, int options) 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, Perl5Compiler.DEFAULT_MASK);Compiles a Perl5 regular expression into a Perl5Pattern instance that can be used by a Perl5Matcher object to perform pattern matching.参数类型为Pattern的org.apache.oro.text.regex中的方法修饰符和类型方法说明voidPerl5Substitution.appendSubstitution(StringBuffer appendBuffer, MatchResult match, int substitutionCount, PatternMatcherInput originalInput, PatternMatcher matcher, Pattern pattern) Appends the substitution to a buffer containing the original input with substitutions applied for the pattern matches found so far.voidStringSubstitution.appendSubstitution(StringBuffer appendBuffer, MatchResult match, int substitutionCount, PatternMatcherInput originalInput, PatternMatcher matcher, Pattern pattern) Appends the substitution to a buffer containing the original input with substitutions applied for the pattern matches found so far.voidSubstitution.appendSubstitution(StringBuffer appendBuffer, MatchResult match, int substitutionCount, PatternMatcherInput originalInput, PatternMatcher matcher, Pattern pattern) Appends the substitution to a buffer containing the original input with substitutions applied for the pattern matches found so far.booleanDetermines if a string (represented as a char[]) contains a pattern.booleanDetermines if a string contains a pattern.booleanPatternMatcher.contains(PatternMatcherInput input, Pattern pattern) Determines if the contents of a PatternMatcherInput, starting from the current offset of the input contains a pattern.booleanDetermines if a string (represented as a char[]) contains a pattern.booleanDetermines if a string contains a pattern.booleanPerl5Matcher.contains(PatternMatcherInput input, Pattern pattern) Determines if the contents of a PatternMatcherInput, starting from the current offset of the input contains a pattern.booleanDetermines if a string (represented as a char[]) exactly matches a given pattern.booleanDetermines if a string exactly matches a given pattern.booleanPatternMatcher.matches(PatternMatcherInput input, Pattern pattern) Determines if the contents of a PatternMatcherInput instance exactly matches a given pattern.booleanDetermines if a string (represented as a char[]) exactly matches a given pattern.booleanDetermines if a string exactly matches a given pattern.booleanPerl5Matcher.matches(PatternMatcherInput input, Pattern pattern) Determines if the contents of a PatternMatcherInput instance exactly matches a given pattern.booleanPatternMatcher.matchesPrefix(char[] input, Pattern pattern) Determines if a prefix of a string (represented as a char[]) matches a given pattern.booleanPatternMatcher.matchesPrefix(char[] input, Pattern pattern, int offset) Determines if a prefix of a string (represented as a char[]) matches a given pattern, starting from a given offset into the string.booleanPatternMatcher.matchesPrefix(String input, Pattern pattern) Determines if a prefix of a string matches a given pattern.booleanPatternMatcher.matchesPrefix(PatternMatcherInput input, Pattern pattern) Determines if a prefix of a PatternMatcherInput instance matches a given pattern.booleanPerl5Matcher.matchesPrefix(char[] input, Pattern pattern) Determines if a prefix of a string (represented as a char[]) matches a given pattern.booleanPerl5Matcher.matchesPrefix(char[] input, Pattern pattern, int offset) Determines if a prefix of a string (represented as a char[]) matches a given pattern, starting from a given offset into the string.booleanPerl5Matcher.matchesPrefix(String input, Pattern pattern) Determines if a prefix of a string matches a given pattern.booleanPerl5Matcher.matchesPrefix(PatternMatcherInput input, Pattern pattern) Determines if a prefix of a PatternMatcherInput instance matches a given pattern.static voidUtil.split(Collection results, PatternMatcher matcher, Pattern pattern, String input) Splits up aStringinstance and stores results as aCollectionof all its substrings using a regular expression as the delimiter.static voidUtil.split(Collection results, PatternMatcher matcher, Pattern pattern, String input, int limit) Splits up aStringinstance and stores results as aListof substrings numbering no more than a specified limit.static VectorUtil.split(PatternMatcher matcher, Pattern pattern, String input) 已过时。static VectorUtil.split(PatternMatcher matcher, Pattern pattern, String input, int limit) 已过时。static intUtil.substitute(StringBuffer result, PatternMatcher matcher, Pattern pattern, Substitution sub, String input, int numSubs) 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.static intUtil.substitute(StringBuffer result, PatternMatcher matcher, Pattern pattern, Substitution sub, PatternMatcherInput input, int numSubs) 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.static StringUtil.substitute(PatternMatcher matcher, Pattern pattern, Substitution sub, String input) Searches a string for a pattern and substitutes only the first occurence of the pattern.static StringUtil.substitute(PatternMatcher matcher, Pattern pattern, Substitution sub, String input, int numSubs) 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.
Util.split(Collection, PatternMatcher, Pattern, String)instead.