Package org.pcre4j

Class Pcre2Code

java.lang.Object
org.pcre4j.Pcre2Code

public class Pcre2Code extends Object
  • Constructor Details

  • Method Details

    • api

      public org.pcre4j.api.IPcre2 api()
      Get the PCRE2 API backing this compiled pattern
      Returns:
      the PCRE2 API
    • handle

      public long handle()
      Get the handle of the compiled pattern
      Returns:
      the handle of the compiled pattern
    • backRefMax

      public int backRefMax()
      Get the number of highest backreference
      Returns:
      the number of highest backreference
    • argOptions

      public EnumSet<Pcre2CompileOption> argOptions()
      Get the compile options
      Returns:
      the compile options
    • captureCount

      public int captureCount()
      Get the number of capturing subpatterns
      Returns:
      the number of capturing subpatterns
    • bsr

      public Pcre2Bsr bsr()
      Get what \R matches: Pcre2Bsr.UNICODE for Unicode line endings Pcre2Bsr.ANYCRLF for CR, LF, or CRLF only
      Returns:
      what \R matches
    • depthLimit

      public int depthLimit()
      Get the backtracking depth limit
      Returns:
      the backtracking depth limit
    • frameSize

      public long frameSize()
      Get the size of backtracking frame
      Returns:
      the size of backtracking frame
    • hasBackslashC

      public boolean hasBackslashC()
      Check if the pattern contains \C
      Returns:
      true if the pattern contains \C, false otherwise
    • hasCrOrLf

      public boolean hasCrOrLf()
      Check if explicit CR or LF matches exist in the pattern
      Returns:
      true if explicit CR or LF matches exist in the pattern, false otherwise
    • heapLimit

      public int heapLimit()
      Get the heap limit
      Returns:
      the heap limit
    • jChanged

      public boolean jChanged()
      Check if the pattern uses (?J) or (?-J)
      Returns:
      true if the pattern uses (?J) or (?-J), false otherwise
    • jitSize

      public long jitSize()
      Get the size of JIT compiled code, or 0
      Returns:
      the size of JIT compiled code, or 0
    • matchEmpty

      public boolean matchEmpty()
      Check if the pattern can match an empty string
      Returns:
      true if the pattern can match an empty string, false otherwise
    • matchLimit

      public int matchLimit()
      Get the match limit
      Returns:
      the match limit
    • maxLookBehind

      public int maxLookBehind()
      Get the length (in characters) of the longest lookbehind assertion
      Returns:
      the length (in characters) of the longest lookbehind assertion
    • minLength

      public int minLength()
      Get the lower bound length of matching strings
      Returns:
      the lower bound length of matching strings
    • nameCount

      public int nameCount()
      Get the number of named subpatterns
      Returns:
      the number of named subpatterns
    • newline

      public Pcre2Newline newline()
      Get the newline sequence
      Returns:
      the newline sequence
    • nameEntrySize

      public int nameEntrySize()
      Get the size of name table entries
      Returns:
      the size of name table entries
    • nameTable

      public Pcre2Code.NameTableEntry[] nameTable()
      Get the name table
      Returns:
      the name table
    • size

      public long size()
      Get the size of the compiled pattern
      Returns:
      the size of the compiled pattern
    • match

      public int match(String subject, int startoffset, EnumSet<Pcre2MatchOption> options, Pcre2MatchData matchData, Pcre2MatchContext matchContext)
      Match this compiled pattern against a given subject string.
      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 matchData is too small, or a negative value if there was no match or an actual error occurred