diff options
| author | realtradam <[email protected]> | 2023-04-12 15:55:33 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2023-04-12 15:55:33 -0400 |
| commit | 0841165881871ee01b782129be681209aeed2423 (patch) | |
| tree | 8a76b61dcaab381b6b42305201ae8b6259f6b6c0 /misc/examples/regex2.c | |
| parent | 554f3e8acf7855b5d6a90cc68cefb7445460b03c (diff) | |
| parent | 0516aa3ae823ed9a22b2c5f776948c8447c32c31 (diff) | |
| download | STC-modified-0841165881871ee01b782129be681209aeed2423.tar.gz STC-modified-0841165881871ee01b782129be681209aeed2423.zip | |
Merge branch 'master' into modified
Diffstat (limited to 'misc/examples/regex2.c')
| -rw-r--r-- | misc/examples/regex2.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/misc/examples/regex2.c b/misc/examples/regex2.c index 20bd323c..3133f7c2 100644 --- a/misc/examples/regex2.c +++ b/misc/examples/regex2.c @@ -15,8 +15,8 @@ int main() {"\\p{Han}+", "This is Han: 王明:那是杂志吗?"}, }; - c_auto (cregex, re) - c_forrange (i, c_ARRAYLEN(s)) + cregex re = {0}; + c_forrange (i, c_arraylen(s)) { int res = cregex_compile(&re, s[i].pattern); if (res < 0) { @@ -30,4 +30,5 @@ int main() printf(" submatch %lld: %.*s\n", k, c_SV(j.match[k])); } } + cregex_drop(&re); } |
