Package org.pcre4j

Class Pcre2JitCode

java.lang.Object
org.pcre4j.Pcre2Code
org.pcre4j.Pcre2JitCode

public class Pcre2JitCode extends Pcre2Code
A JIT-compiled pattern.
  • Constructor Details

    • Pcre2JitCode

      public Pcre2JitCode(String pattern, EnumSet<Pcre2CompileOption> options, EnumSet<Pcre2JitOption> jitOptions, Pcre2CompileContext compileContext)
      Constructor for Pcre2JitCode
      Parameters:
      pattern - the pattern to compile
      options - the flags to compile the pattern with, see Pcre2CompileOption or null for default options
      jitOptions - the flags to compile the pattern with JIT, see Pcre2JitOption or null for default options
      compileContext - the compile context to use or null
    • Pcre2JitCode

      public Pcre2JitCode(org.pcre4j.api.IPcre2 api, String pattern, EnumSet<Pcre2CompileOption> options, EnumSet<Pcre2JitOption> jitOptions, Pcre2CompileContext compileContext)
      Constructor for Pcre2JitCode
      Parameters:
      api - the PCRE2 API to use
      pattern - the pattern to compile
      options - the flags to compile the pattern with, see Pcre2CompileOption or null for default options
      jitOptions - the flags to compile the pattern with JIT, see Pcre2JitOption or null for default options
      compileContext - the compile context to use or null
  • Method Details

    • getSupportedMatchOptions

      public static EnumSet<Pcre2MatchOption> getSupportedMatchOptions()
      Get the supported match options for JIT-compiled patterns.
      Returns:
      the supported match options
    • match

      public int match(String subject, int startOffset, EnumSet<Pcre2MatchOption> options, Pcre2MatchData matchData, Pcre2MatchContext matchContext)
      Description copied from class: Pcre2Code
      Match this compiled pattern against a given subject string.
      Overrides:
      match in class Pcre2Code
      Parameters:
      subject - the subject string to match this pattern against
      startOffset - offset in the subject at which to start matching
      options - the options, see Pcre2MatchOption
      matchData - the match data to store the results in
      matchContext - the match context to use or null
      Returns:
      the number of captures plus one, zero if the is too small, or a negative value if there was no match or an actual error occurred