Skip to content

Commit

Permalink
sample: Add one more sample to listcap
Browse files Browse the repository at this point in the history
  • Loading branch information
k-takata committed Dec 7, 2016
1 parent a444d26 commit 0979a9f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sample/listcap.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ extern int main(int argc, char* argv[])
static UChar* str3 = (UChar* )"0123";
static UChar* pattern3 = (UChar* )"(?@.)(?@.)(?@.)(?@.)";

static UChar* str4 = (UChar* )"((abc)(abc))";
static UChar* pattern4 = (UChar* )"\\((?@(?:[^(]|\\g<0>)*)\\)";

/* enable capture hostory */
onig_copy_syntax(&syn, ONIG_SYNTAX_DEFAULT);
onig_set_syntax_op2(&syn,
Expand All @@ -124,6 +127,7 @@ extern int main(int argc, char* argv[])
r |= ex(str1, pattern1, &syn);
r |= ex(str2, pattern2, &syn);
r |= ex(str3, pattern3, &syn);
r |= ex(str4, pattern4, &syn);

onig_end();
return r;
Expand Down

0 comments on commit 0979a9f

Please sign in to comment.