首页 > 解决方案 > 任何人都可以在 PCRE2 中包含 JIT 功能吗?

问题描述

我写了一个工作 pcre2.c。现在我想修改它以使用 JIT 编译和 jit 匹配,但我不让它与 pcre2 页面的常见问题解答一起使用。

http://www.rtsdd.ru/downloads/ADANCURSESN/pcre2-10.31/src/pcre2_jit_match.c

re = pcre2_compile(
  pattern,               /* the pattern */
  PCRE2_ZERO_TERMINATED, /* indicates pattern is zero-terminated */
  PCRE2_CASELESS,        /* default options */
  &errornumber,          /* for error number */
  &erroroffset,          /* for error offset */
  NULL);                 /* use default compile context */

if (re == NULL)
  {
  PCRE2_UCHAR buffer[256];
  pcre2_get_error_message(errornumber, buffer, sizeof(buffer));
  printf("PCRE2 compilation failed at offset %d: %s\n", (int)erroroffset,
    buffer);
  return 1;
  }


match_data = pcre2_match_data_create_from_pattern(re, NULL);

rc = pcre2_match(
  re,                   /* the compiled pattern */
  subject,              /* the subject string */
  subject_length,       /* the length of the subject */
  55,                   /* start at offset 0 in the subject */
  0,                    /* default options */
  match_data,           /* block for storing the result */
  NULL);                /* use default match context */

}

JIT 部分必须包含在 pcre2_compile() 之后。但我还没有找到可行的解决方案。

标签: c

解决方案


推荐阅读