<commit_before>#include <stdio.h>

#include <ngx_core.h>
#include <ngx_palloc.h>
#include <ngx_string.h>

int main (int argc, char *argv[]) {
    int rc, captures[(1 + 2) * 3];
    ngx_str_t unparsed_uri = ngx_string("small_light(p=medium)");
    ngx_str_t pattern = ngx_string("small_light\\(([^\\)]*)\\)");
    ngx_pool_t *pool;
    ngx_regex_compile_t rgc;
    u_char errstr[NGX_MAX_CONF_ERRSTR];
    u_char *define_pattern_s;

    ngx_memzero(&rgc, sizeof(ngx_regex_compile_t));
 
    pool = ngx_create_pool(NGX_DEFAULT_POOL_SIZE, NULL);

    printf("string:%s\n", pattern.data);

    rgc.pattern  = pattern;
    rgc.pool     = pool;
    rgc.err.len  = NGX_MAX_CONF_ERRSTR;
    rgc.err.data = errstr;

    if (ngx_regex_compile(&rgc) != NGX_OK) {
        ngx_destroy_pool(pool);
        printf("not matched\n");
        return NGX_ERROR;
    }

    rc = ngx_regex_exec(rgc.regex, &unparsed_uri, captures, (1 + 2) * 3);
<commit_msg>forgot to init for regex<commit_after>#include <stdio.h>

#include <ngx_core.h>
#include <ngx_palloc.h>
#include <ngx_string.h>

int main (int argc, char *argv[]) {
    int rc, captures[(1 + 2) * 3];
    ngx_str_t unparsed_uri = ngx_string("small_light(p=medium)");
    ngx_str_t pattern = ngx_string("small_light\\(([^\\)]*)\\)");
    ngx_pool_t *pool;
    ngx_regex_compile_t rgc;
    u_char errstr[NGX_MAX_CONF_ERRSTR];
    u_char *define_pattern_s;

    ngx_regex_init();

    ngx_memzero(&rgc, sizeof(ngx_regex_compile_t));
 
    pool = ngx_create_pool(NGX_DEFAULT_POOL_SIZE, NULL);

    printf("string:%s\n", pattern.data);

    rgc.pattern  = pattern;
    rgc.pool     = pool;
    rgc.err.len  = NGX_MAX_CONF_ERRSTR;
    rgc.err.data = errstr;

    if (ngx_regex_compile(&rgc) != NGX_OK) {
        ngx_destroy_pool(pool);
        printf("not matched\n");
        return NGX_ERROR;
    }

    rc = ngx_regex_exec(rgc.regex, &unparsed_uri, captures, (1 + 2) * 3);

{'fraction_non_alphanumeric': 0.1486344537815126, 'fraction_numerical': 0.0063025210084033615, 'mean_word_length': 3.50354609929078, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6670537', 'n_tokens_mistral': 810, 'n_tokens_neox': 782, 'n_words': 131}