接口的使用
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.textPattern的使用

    声明为Patternorg.apache.oro.text中的字段
    修饰符和类型
    字段
    说明
    MatchActionInfo.fieldSeparator
    The field separator used by the MatchActionProcessor.
    MatchActionInfo.pattern
    The pattern found in the line of input.
    返回Patternorg.apache.oro.text中的方法
    修饰符和类型
    方法
    说明
    final Pattern
    GenericPatternCache.addPattern(String expression)
    Same as calling
    final Pattern
    GenericPatternCache.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.
    GlobCompiler.compile(String pattern)
    Same as calling compile(pattern, GlobCompiler.DEFAULT_MASK);
    GlobCompiler.compile(String pattern, int options)
    Compiles a Glob expression into a Perl5Pattern instance that can be used by a Perl5Matcher object to perform pattern matching.
    final Pattern
    GenericPatternCache.getPattern(String expression)
    Same as calling
    final Pattern
    GenericPatternCache.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.awkPattern的使用

    修饰符和类型
    说明
    final class 
    An implementation of the Pattern interface for Awk regular expressions.
    返回Patternorg.apache.oro.text.awk中的方法
    修饰符和类型
    方法
    说明
    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.
    AwkCompiler.compile(String pattern)
    Same as calling compile(pattern, AwkCompiler.DEFAULT_MASK);
    AwkCompiler.compile(String pattern, int options)
    Compiles an Awk regular expression into an AwkPattern instance that can be used by an AwkMatcher object to perform pattern matching.
    参数类型为Patternorg.apache.oro.text.awk中的方法
    修饰符和类型
    方法
    说明
    boolean
    AwkMatcher.contains(char[] input, Pattern pattern)
    Determines if a string (represented as a char[]) contains a pattern.
    boolean
    AwkMatcher.contains(String input, Pattern pattern)
    Determines if a string contains a pattern.
    boolean
    AwkMatcher.contains(AwkStreamInput input, Pattern pattern)
    Determines if the contents of an AwkStreamInput, starting from the current offset of the input contains a pattern.
    boolean
    AwkMatcher.contains(PatternMatcherInput input, Pattern pattern)
    Determines if the contents of a PatternMatcherInput, starting from the current offset of the input contains a pattern.
    boolean
    AwkMatcher.matches(char[] input, Pattern pattern)
    Determines if a string (represented as a char[]) exactly matches a given pattern.
    boolean
    AwkMatcher.matches(String input, Pattern pattern)
    Determines if a string exactly matches a given pattern.
    boolean
    AwkMatcher.matches(PatternMatcherInput input, Pattern pattern)
    Determines if the contents of a PatternMatcherInput instance exactly matches a given pattern.
    boolean
    AwkMatcher.matchesPrefix(char[] input, Pattern pattern)
    Determines if a prefix of a string (represented as a char[]) matches a given pattern.
    boolean
    AwkMatcher.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.
    boolean
    AwkMatcher.matchesPrefix(String input, Pattern pattern)
    Determines if a prefix of a string matches a given pattern.
    boolean
    AwkMatcher.matchesPrefix(PatternMatcherInput input, Pattern pattern)
    Determines if a prefix of a PatternMatcherInput instance matches a given pattern.
  • org.apache.oro.text.regexPattern的使用

    修饰符和类型
    说明
    final class 
    An 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.
    PatternCompiler.compile(String pattern)
    Compiles a regular expression into a data structure that can be used by a PatternMatcher implementation to perform pattern matching.
    PatternCompiler.compile(String pattern, int options)
    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.
    Perl5Compiler.compile(String pattern)
    Same as calling compile(pattern, Perl5Compiler.DEFAULT_MASK);
    Perl5Compiler.compile(String pattern, int options)
    Compiles a Perl5 regular expression into a Perl5Pattern instance that can be used by a Perl5Matcher object to perform pattern matching.
    参数类型为Patternorg.apache.oro.text.regex中的方法
    修饰符和类型
    方法
    说明
    void
    Perl5Substitution.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.
    void
    StringSubstitution.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.
    void
    Substitution.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.
    boolean
    PatternMatcher.contains(char[] input, Pattern pattern)
    Determines if a string (represented as a char[]) contains a pattern.
    boolean
    PatternMatcher.contains(String input, Pattern pattern)
    Determines if a string contains a pattern.
    boolean
    PatternMatcher.contains(PatternMatcherInput input, Pattern pattern)
    Determines if the contents of a PatternMatcherInput, starting from the current offset of the input contains a pattern.
    boolean
    Perl5Matcher.contains(char[] input, Pattern pattern)
    Determines if a string (represented as a char[]) contains a pattern.
    boolean
    Perl5Matcher.contains(String input, Pattern pattern)
    Determines if a string contains a pattern.
    boolean
    Perl5Matcher.contains(PatternMatcherInput input, Pattern pattern)
    Determines if the contents of a PatternMatcherInput, starting from the current offset of the input contains a pattern.
    boolean
    PatternMatcher.matches(char[] input, Pattern pattern)
    Determines if a string (represented as a char[]) exactly matches a given pattern.
    boolean
    PatternMatcher.matches(String input, Pattern pattern)
    Determines if a string exactly matches a given pattern.
    boolean
    PatternMatcher.matches(PatternMatcherInput input, Pattern pattern)
    Determines if the contents of a PatternMatcherInput instance exactly matches a given pattern.
    boolean
    Perl5Matcher.matches(char[] input, Pattern pattern)
    Determines if a string (represented as a char[]) exactly matches a given pattern.
    boolean
    Perl5Matcher.matches(String input, Pattern pattern)
    Determines if a string exactly matches a given pattern.
    boolean
    Perl5Matcher.matches(PatternMatcherInput input, Pattern pattern)
    Determines if the contents of a PatternMatcherInput instance exactly matches a given pattern.
    boolean
    PatternMatcher.matchesPrefix(char[] input, Pattern pattern)
    Determines if a prefix of a string (represented as a char[]) matches a given pattern.
    boolean
    PatternMatcher.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.
    boolean
    PatternMatcher.matchesPrefix(String input, Pattern pattern)
    Determines if a prefix of a string matches a given pattern.
    boolean
    PatternMatcher.matchesPrefix(PatternMatcherInput input, Pattern pattern)
    Determines if a prefix of a PatternMatcherInput instance matches a given pattern.
    boolean
    Perl5Matcher.matchesPrefix(char[] input, Pattern pattern)
    Determines if a prefix of a string (represented as a char[]) matches a given pattern.
    boolean
    Perl5Matcher.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.
    boolean
    Perl5Matcher.matchesPrefix(String input, Pattern pattern)
    Determines if a prefix of a string matches a given pattern.
    boolean
    Perl5Matcher.matchesPrefix(PatternMatcherInput input, Pattern pattern)
    Determines if a prefix of a PatternMatcherInput instance matches a given pattern.
    static void
    Util.split(Collection results, PatternMatcher matcher, Pattern pattern, String input)
    Splits up a String instance and stores results as a Collection of all its substrings using a regular expression as the delimiter.
    static void
    Util.split(Collection results, PatternMatcher matcher, Pattern pattern, String input, int limit)
    Splits up a String instance and stores results as a List of substrings numbering no more than a specified limit.
    static Vector
    Util.split(PatternMatcher matcher, Pattern pattern, String input)
    static Vector
    Util.split(PatternMatcher matcher, Pattern pattern, String input, int limit)
    static int
    Util.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 int
    Util.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 String
    Util.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 String
    Util.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.