Class Pcre2

java.lang.Object
org.pcre4j.ffm.Pcre2
All Implemented Interfaces:
org.pcre4j.api.IPcre2

public class Pcre2 extends Object implements org.pcre4j.api.IPcre2
A PCRE2 API using the Foreign Function & Memory API.
  • Field Summary

    Fields inherited from interface org.pcre4j.api.IPcre2

    ALLOW_EMPTY_CLASS, ALT_BSUX, ALT_CIRCUMFLEX, ALT_VERBNAMES, ANCHORED, AUTO_CALLOUT, BSR_ANYCRLF, BSR_UNICODE, CASELESS, CONFIG_BSR, CONFIG_COMPILED_WIDTHS, CONFIG_DEPTHLIMIT, CONFIG_HEAPLIMIT, CONFIG_JIT, CONFIG_JITTARGET, CONFIG_LINKSIZE, CONFIG_MATCHLIMIT, CONFIG_NEVER_BACKSLASH_C, CONFIG_NEWLINE, CONFIG_PARENSLIMIT, CONFIG_RECURSIONLIMIT, CONFIG_STACKRECURSE, CONFIG_TABLES_LENGTH, CONFIG_UNICODE, CONFIG_UNICODE_VERSION, CONFIG_VERSION, CONVERT_GLOB, CONVERT_GLOB_NO_STARSTAR, CONVERT_GLOB_NO_WILD_SEPARATOR, CONVERT_NO_UTF_CHECK, CONVERT_POSIX_BASIC, CONVERT_POSIX_EXTENDED, CONVERT_UTF, COPY_MATCHED_SUBJECT, DFA_RESTART, DFA_SHORTEST, DISABLE_RECURSELOOP_CHECK, DOLLAR_ENDONLY, DOTALL, DUPNAMES, ENDANCHORED, ERROR_ALPHA_ASSERTION_UNKNOWN, ERROR_BACKSLASH_C_CALLER_DISABLED, ERROR_BACKSLASH_C_LIBRARY_DISABLED, ERROR_BACKSLASH_C_SYNTAX, ERROR_BACKSLASH_G_SYNTAX, ERROR_BACKSLASH_K_IN_LOOKAROUND, ERROR_BACKSLASH_K_SYNTAX, ERROR_BACKSLASH_N_IN_CLASS, ERROR_BACKSLASH_O_MISSING_BRACE, ERROR_BACKSLASH_U_CODE_POINT_TOO_BIG, ERROR_BAD_LITERAL_OPTIONS, ERROR_BAD_OPTIONS, ERROR_BAD_RELATIVE_REFERENCE, ERROR_BAD_SUBPATTERN_REFERENCE, ERROR_BADDATA, ERROR_BADMAGIC, ERROR_BADMODE, ERROR_BADOFFSET, ERROR_BADOFFSETLIMIT, ERROR_BADOPTION, ERROR_BADREPESCAPE, ERROR_BADREPLACEMENT, ERROR_BADSERIALIZEDDATA, ERROR_BADSUBSPATTERN, ERROR_BADSUBSTITUTION, ERROR_BADUTFOFFSET, ERROR_CALLOUT, ERROR_CALLOUT_BAD_STRING_DELIMITER, ERROR_CALLOUT_NO_STRING_DELIMITER, ERROR_CALLOUT_NUMBER_TOO_BIG, ERROR_CALLOUT_STRING_TOO_LONG, ERROR_CLASS_INVALID_RANGE, ERROR_CLASS_RANGE_ORDER, ERROR_CODE_POINT_TOO_BIG, ERROR_CONDITION_ASSERTION_EXPECTED, ERROR_CONDITION_ATOMIC_ASSERTION_EXPECTED, ERROR_CONVERT_SYNTAX, ERROR_DEFINE_TOO_MANY_BRANCHES, ERROR_DEPTHLIMIT, ERROR_DFA_BADRESTART, ERROR_DFA_RECURSE, ERROR_DFA_UCOND, ERROR_DFA_UFUNC, ERROR_DFA_UINVALID_UTF, ERROR_DFA_UITEM, ERROR_DFA_WSSIZE, ERROR_DUPLICATE_SUBPATTERN_NAME, ERROR_END_BACKSLASH, ERROR_END_BACKSLASH_C, ERROR_ESCAPE_INVALID_IN_CLASS, ERROR_ESCAPE_INVALID_IN_VERB, ERROR_HEAP_FAILED, ERROR_HEAPLIMIT, ERROR_INTERNAL, ERROR_INTERNAL_BAD_CODE, ERROR_INTERNAL_BAD_CODE_AUTO_POSSESS, ERROR_INTERNAL_BAD_CODE_IN_SKIP, ERROR_INTERNAL_BAD_CODE_LOOKBEHINDS, ERROR_INTERNAL_CODE_OVERFLOW, ERROR_INTERNAL_DUPMATCH, ERROR_INTERNAL_MISSING_SUBPATTERN, ERROR_INTERNAL_OVERRAN_WORKSPACE, ERROR_INTERNAL_PARSED_OVERFLOW, ERROR_INTERNAL_STUDY_ERROR, ERROR_INTERNAL_UNEXPECTED_REPEAT, ERROR_INTERNAL_UNKNOWN_NEWLINE, ERROR_INVALID_AFTER_PARENS_QUERY, ERROR_INVALID_HEXADECIMAL, ERROR_INVALID_HYPHEN_IN_OPTIONS, ERROR_INVALID_OCTAL, ERROR_INVALID_SUBPATTERN_NAME, ERROR_INVALIDOFFSET, ERROR_JIT_BADOPTION, ERROR_JIT_STACKLIMIT, ERROR_LOOKBEHIND_INVALID_BACKSLASH_C, ERROR_LOOKBEHIND_NOT_FIXED_LENGTH, ERROR_LOOKBEHIND_TOO_COMPLICATED, ERROR_LOOKBEHIND_TOO_LONG, ERROR_MALFORMED_UNICODE_PROPERTY, ERROR_MARK_MISSING_ARGUMENT, ERROR_MATCHLIMIT, ERROR_MISSING_CALLOUT_CLOSING, ERROR_MISSING_CLOSING_PARENTHESIS, ERROR_MISSING_COMMENT_CLOSING, ERROR_MISSING_CONDITION_CLOSING, ERROR_MISSING_NAME_TERMINATOR, ERROR_MISSING_OCTAL_OR_HEX_DIGITS, ERROR_MISSING_SQUARE_BRACKET, ERROR_MIXEDTABLES, ERROR_NO_SURROGATES_IN_UTF16, ERROR_NOMATCH, ERROR_NOMEMORY, ERROR_NOSUBSTRING, ERROR_NOUNIQUESUBSTRING, ERROR_NULL, ERROR_NULL_PATTERN, ERROR_OCTAL_BYTE_TOO_BIG, ERROR_PARENS_QUERY_R_MISSING_CLOSING, ERROR_PARENTHESES_NEST_TOO_DEEP, ERROR_PARENTHESES_STACK_CHECK, ERROR_PARTIAL, ERROR_PATTERN_STRING_TOO_LONG, ERROR_PATTERN_TOO_COMPLICATED, ERROR_PATTERN_TOO_LARGE, ERROR_POSIX_CLASS_NOT_IN_CLASS, ERROR_POSIX_NO_SUPPORT_COLLATING, ERROR_QUANTIFIER_INVALID, ERROR_QUANTIFIER_OUT_OF_ORDER, ERROR_QUANTIFIER_TOO_BIG, ERROR_QUERY_BARJX_NEST_TOO_DEEP, ERROR_RECURSELOOP, ERROR_RECURSIONLIMIT, ERROR_REPMISSINGBRACE, ERROR_SCRIPT_RUN_NOT_AVAILABLE, ERROR_SUBPATTERN_NAME_EXPECTED, ERROR_SUBPATTERN_NAME_TOO_LONG, ERROR_SUBPATTERN_NAMES_MISMATCH, ERROR_SUBPATTERN_NUMBER_TOO_BIG, ERROR_SUPPORTED_ONLY_IN_UNICODE, ERROR_TOO_MANY_CAPTURES, ERROR_TOO_MANY_CONDITION_BRANCHES, ERROR_TOO_MANY_NAMED_SUBPATTERNS, ERROR_TOOMANYREPLACE, ERROR_UCP_IS_DISABLED, ERROR_UNAVAILABLE, ERROR_UNICODE_DISALLOWED_CODE_POINT, ERROR_UNICODE_NOT_SUPPORTED, ERROR_UNICODE_PROPERTIES_UNAVAILABLE, ERROR_UNKNOWN_ESCAPE, ERROR_UNKNOWN_POSIX_CLASS, ERROR_UNKNOWN_UNICODE_PROPERTY, ERROR_UNMATCHED_CLOSING_PARENTHESIS, ERROR_UNRECOGNIZED_AFTER_QUERY_P, ERROR_UNSET, ERROR_UNSUPPORTED_ESCAPE_SEQUENCE, ERROR_UTF_IS_DISABLED, ERROR_UTF16_ERR1, ERROR_UTF16_ERR2, ERROR_UTF16_ERR3, ERROR_UTF32_ERR1, ERROR_UTF32_ERR2, ERROR_UTF8_ERR1, ERROR_UTF8_ERR10, ERROR_UTF8_ERR11, ERROR_UTF8_ERR12, ERROR_UTF8_ERR13, ERROR_UTF8_ERR14, ERROR_UTF8_ERR15, ERROR_UTF8_ERR16, ERROR_UTF8_ERR17, ERROR_UTF8_ERR18, ERROR_UTF8_ERR19, ERROR_UTF8_ERR2, ERROR_UTF8_ERR20, ERROR_UTF8_ERR21, ERROR_UTF8_ERR3, ERROR_UTF8_ERR4, ERROR_UTF8_ERR5, ERROR_UTF8_ERR6, ERROR_UTF8_ERR7, ERROR_UTF8_ERR8, ERROR_UTF8_ERR9, ERROR_VERB_ARGUMENT_NOT_ALLOWED, ERROR_VERB_NAME_TOO_LONG, ERROR_VERB_UNKNOWN, ERROR_VERSION_CONDITION_SYNTAX, ERROR_ZERO_RELATIVE_REFERENCE, EXTENDED, EXTENDED_MORE, EXTRA_ALLOW_LOOKAROUND_BSK, EXTRA_ALLOW_SURROGATE_ESCAPES, EXTRA_ALT_BSUX, EXTRA_ASCII_BSD, EXTRA_ASCII_BSS, EXTRA_ASCII_BSW, EXTRA_ASCII_DIGIT, EXTRA_ASCII_POSIX, EXTRA_BAD_ESCAPE_IS_LITERAL, EXTRA_CASELESS_RESTRICT, EXTRA_ESCAPED_CR_IS_LF, EXTRA_MATCH_LINE, EXTRA_MATCH_WORD, FIRSTLINE, INFO_ALLOPTIONS, INFO_ARGOPTIONS, INFO_BACKREFMAX, INFO_BSR, INFO_CAPTURECOUNT, INFO_DEPTHLIMIT, INFO_EXTRAOPTIONS, INFO_FIRSTBITMAP, INFO_FIRSTCODETYPE, INFO_FIRSTCODEUNIT, INFO_FRAMESIZE, INFO_HASBACKSLASHC, INFO_HASCRORLF, INFO_HEAPLIMIT, INFO_JCHANGED, INFO_JITSIZE, INFO_LASTCODETYPE, INFO_LASTCODEUNIT, INFO_MATCHEMPTY, INFO_MATCHLIMIT, INFO_MAXLOOKBEHIND, INFO_MINLENGTH, INFO_NAMECOUNT, INFO_NAMEENTRYSIZE, INFO_NAMETABLE, INFO_NEWLINE, INFO_RECURSIONLIMIT, INFO_SIZE, JIT_COMPLETE, JIT_INVALID_UTF, JIT_PARTIAL_HARD, JIT_PARTIAL_SOFT, LITERAL, MATCH_INVALID_UTF, MATCH_UNSET_BACKREF, MULTILINE, NEVER_BACKSLASH_C, NEVER_UCP, NEVER_UTF, NEWLINE_ANY, NEWLINE_ANYCRLF, NEWLINE_CR, NEWLINE_CRLF, NEWLINE_LF, NEWLINE_NUL, NO_AUTO_CAPTURE, NO_AUTO_POSSESS, NO_DOTSTAR_ANCHOR, NO_JIT, NO_START_OPTIMIZE, NO_UTF_CHECK, NOTBOL, NOTEMPTY, NOTEMPTY_ATSTART, NOTEOL, PARTIAL_HARD, PARTIAL_SOFT, SUBSTITUTE_EXTENDED, SUBSTITUTE_GLOBAL, SUBSTITUTE_LITERAL, SUBSTITUTE_MATCHED, SUBSTITUTE_OVERFLOW_LENGTH, SUBSTITUTE_REPLACEMENT_ONLY, SUBSTITUTE_UNKNOWN_UNSET, SUBSTITUTE_UNSET_EMPTY, UCP, UNGREEDY, USE_OFFSET_LIMIT, UTF
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new PCRE2 API using the common library name "pcre2-8".
    Pcre2(String library, String suffix)
    Constructs a new PCRE2 API using the specified library name and function suffix.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    codeFree(long code)
     
    long
    compile(String pattern, int options, int[] errorcode, long[] erroroffset, long ccontext)
     
    long
    compileContextCopy(long ccontext)
     
    long
    compileContextCreate(long gcontext)
     
    void
    compileContextFree(long ccontext)
     
    int
    config(int what)
     
    int
    config(int what, int[] where)
     
    int
    config(int what, ByteBuffer where)
     
    long
    generalContextCopy(long gcontext)
     
    long
    generalContextCreate(long privateMalloc, long privateFree, long memoryData)
     
    void
    generalContextFree(long gcontext)
     
    int
    getErrorMessage(int errorcode, ByteBuffer buffer)
     
    void
    getOvector(long matchData, long[] ovector)
     
    int
    getOvectorCount(long matchData)
     
    int
    jitCompile(long code, int options)
     
    int
    jitMatch(long code, String subject, int startoffset, int options, long matchData, long mcontext)
     
    void
    jitStackAssign(long mcontext, long callback, long data)
     
    long
    jitStackCreate(long startsize, long maxsize, long gcontext)
     
    void
    jitStackFree(long jitStack)
     
    int
    match(long code, String subject, int startoffset, int options, long matchData, long mcontext)
     
    long
    matchContextCopy(long mcontext)
     
    long
    matchContextCreate(long gcontext)
     
    void
    matchContextFree(long mcontext)
     
    long
    matchDataCreate(int ovecsize, long gcontext)
     
    long
    matchDataCreateFromPattern(long code, long gcontext)
     
    void
    matchDataFree(long matchData)
     
    int
    patternInfo(long code, int what)
     
    int
    patternInfo(long code, int what, int[] where)
     
    int
    patternInfo(long code, int what, long[] where)
     
    int
    patternInfo(long code, int what, ByteBuffer where)
     
    int
    setNewline(long ccontext, int newline)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Pcre2

      public Pcre2()
      Constructs a new PCRE2 API using the common library name "pcre2-8".
    • Pcre2

      public Pcre2(String library, String suffix)
      Constructs a new PCRE2 API using the specified library name and function suffix.
      Parameters:
      library - the library name (e.g. "pcre2-8" for "pcre2-8.dll" on Windows, "libpcre2-8.so" on Linux, "libpcre2-8.dylib" on macOS) or an absolute path to the library file
      suffix - the function suffix (e.g. "_8" as in "pcre2_compile_8")
  • Method Details

    • config

      public int config(int what)
      Specified by:
      config in interface org.pcre4j.api.IPcre2
    • config

      public int config(int what, int[] where)
      Specified by:
      config in interface org.pcre4j.api.IPcre2
    • config

      public int config(int what, ByteBuffer where)
      Specified by:
      config in interface org.pcre4j.api.IPcre2
    • generalContextCreate

      public long generalContextCreate(long privateMalloc, long privateFree, long memoryData)
      Specified by:
      generalContextCreate in interface org.pcre4j.api.IPcre2
    • generalContextCopy

      public long generalContextCopy(long gcontext)
      Specified by:
      generalContextCopy in interface org.pcre4j.api.IPcre2
    • generalContextFree

      public void generalContextFree(long gcontext)
      Specified by:
      generalContextFree in interface org.pcre4j.api.IPcre2
    • compileContextCreate

      public long compileContextCreate(long gcontext)
      Specified by:
      compileContextCreate in interface org.pcre4j.api.IPcre2
    • compileContextCopy

      public long compileContextCopy(long ccontext)
      Specified by:
      compileContextCopy in interface org.pcre4j.api.IPcre2
    • compileContextFree

      public void compileContextFree(long ccontext)
      Specified by:
      compileContextFree in interface org.pcre4j.api.IPcre2
    • compile

      public long compile(String pattern, int options, int[] errorcode, long[] erroroffset, long ccontext)
      Specified by:
      compile in interface org.pcre4j.api.IPcre2
    • codeFree

      public void codeFree(long code)
      Specified by:
      codeFree in interface org.pcre4j.api.IPcre2
    • getErrorMessage

      public int getErrorMessage(int errorcode, ByteBuffer buffer)
      Specified by:
      getErrorMessage in interface org.pcre4j.api.IPcre2
    • patternInfo

      public int patternInfo(long code, int what)
      Specified by:
      patternInfo in interface org.pcre4j.api.IPcre2
    • patternInfo

      public int patternInfo(long code, int what, int[] where)
      Specified by:
      patternInfo in interface org.pcre4j.api.IPcre2
    • patternInfo

      public int patternInfo(long code, int what, long[] where)
      Specified by:
      patternInfo in interface org.pcre4j.api.IPcre2
    • patternInfo

      public int patternInfo(long code, int what, ByteBuffer where)
      Specified by:
      patternInfo in interface org.pcre4j.api.IPcre2
    • jitCompile

      public int jitCompile(long code, int options)
      Specified by:
      jitCompile in interface org.pcre4j.api.IPcre2
    • jitMatch

      public int jitMatch(long code, String subject, int startoffset, int options, long matchData, long mcontext)
      Specified by:
      jitMatch in interface org.pcre4j.api.IPcre2
    • jitStackCreate

      public long jitStackCreate(long startsize, long maxsize, long gcontext)
      Specified by:
      jitStackCreate in interface org.pcre4j.api.IPcre2
    • jitStackFree

      public void jitStackFree(long jitStack)
      Specified by:
      jitStackFree in interface org.pcre4j.api.IPcre2
    • jitStackAssign

      public void jitStackAssign(long mcontext, long callback, long data)
      Specified by:
      jitStackAssign in interface org.pcre4j.api.IPcre2
    • matchDataCreate

      public long matchDataCreate(int ovecsize, long gcontext)
      Specified by:
      matchDataCreate in interface org.pcre4j.api.IPcre2
    • matchDataCreateFromPattern

      public long matchDataCreateFromPattern(long code, long gcontext)
      Specified by:
      matchDataCreateFromPattern in interface org.pcre4j.api.IPcre2
    • matchDataFree

      public void matchDataFree(long matchData)
      Specified by:
      matchDataFree in interface org.pcre4j.api.IPcre2
    • matchContextCreate

      public long matchContextCreate(long gcontext)
      Specified by:
      matchContextCreate in interface org.pcre4j.api.IPcre2
    • matchContextCopy

      public long matchContextCopy(long mcontext)
      Specified by:
      matchContextCopy in interface org.pcre4j.api.IPcre2
    • matchContextFree

      public void matchContextFree(long mcontext)
      Specified by:
      matchContextFree in interface org.pcre4j.api.IPcre2
    • match

      public int match(long code, String subject, int startoffset, int options, long matchData, long mcontext)
      Specified by:
      match in interface org.pcre4j.api.IPcre2
    • getOvectorCount

      public int getOvectorCount(long matchData)
      Specified by:
      getOvectorCount in interface org.pcre4j.api.IPcre2
    • getOvector

      public void getOvector(long matchData, long[] ovector)
      Specified by:
      getOvector in interface org.pcre4j.api.IPcre2
    • setNewline

      public int setNewline(long ccontext, int newline)
      Specified by:
      setNewline in interface org.pcre4j.api.IPcre2