diff options
| author | Tyge Løvset <[email protected]> | 2023-04-08 22:37:06 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-04-08 22:37:06 +0200 |
| commit | 43120f2863a67db416ec3b379eb820e2704cafb7 (patch) | |
| tree | f3b9917940f94c1582bc39ea6f56b735295ec861 /misc/examples/splitstr.c | |
| parent | e8be14dfc894eeac859f0287d4d5b4f4745c0585 (diff) | |
| parent | 6426ac05eb8c4dc1ab22aae2eb4139f9671981b7 (diff) | |
| download | STC-modified-43120f2863a67db416ec3b379eb820e2704cafb7.tar.gz STC-modified-43120f2863a67db416ec3b379eb820e2704cafb7.zip | |
Merge pull request #53 from tylov/dev42
Version 4.2 RC
Diffstat (limited to 'misc/examples/splitstr.c')
| -rw-r--r-- | misc/examples/splitstr.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/misc/examples/splitstr.c b/misc/examples/splitstr.c index 5bf02d42..2bc6fc07 100644 --- a/misc/examples/splitstr.c +++ b/misc/examples/splitstr.c @@ -10,10 +10,11 @@ int main() c_fortoken (i, "Hello World C99!", " ") printf("'%.*s'\n", c_SV(i.token)); - puts("\nSplit with c_formatch (regex):"); - c_with (cregex re = cregex_from("[^ ]+"), cregex_drop(&re)) - c_formatch (i, &re, " Hello World C99! ") - printf("'%.*s'\n", c_SV(i.match[0])); + cregex re = cregex_from("[^ ]+"); + c_formatch (i, &re, " Hello World C99! ") + printf("'%.*s'\n", c_SV(i.match[0])); + + cregex_drop(&re); } |
