Interface PatternCompiler

All Known Implementing Classes:
Platform.JdkPatternCompiler

interface PatternCompiler
Pluggable interface for compiling a regex pattern. By default this package uses the java.util.regex library, but an alternate implementation can be supplied using the ServiceLoader mechanism.
  • Method Summary

    Modifier and Type
    Method
    Description
    compile(String pattern)
    Compiles the given pattern.
    boolean
    Returns true if the regex implementation behaves like Perl -- notably, by supporting possessive quantifiers but also being susceptible to catastrophic backtracking.
  • Method Details

    • compile

      CommonPattern compile(String pattern)
      Compiles the given pattern.
      Throws:
      IllegalArgumentException - if the pattern is invalid
    • isPcreLike

      boolean isPcreLike()
      Returns true if the regex implementation behaves like Perl -- notably, by supporting possessive quantifiers but also being susceptible to catastrophic backtracking.