diff options
| author | Tyge Løvset <[email protected]> | 2023-01-02 10:33:04 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2023-01-02 10:33:04 +0100 |
| commit | 5c454e721656618c36674e0df676091106592c2d (patch) | |
| tree | 95d7e4f6355c8fbfebd8aba5474ab90e3f13f120 /misc/examples/regex2.c | |
| parent | 8c6ba8a3444e4b8640e7fe04f565cef57c850432 (diff) | |
| download | STC-modified-5c454e721656618c36674e0df676091106592c2d.tar.gz STC-modified-5c454e721656618c36674e0df676091106592c2d.zip | |
Fixes prev. commit.
Diffstat (limited to 'misc/examples/regex2.c')
| -rw-r--r-- | misc/examples/regex2.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/misc/examples/regex2.c b/misc/examples/regex2.c index 55f8cfc2..abae5695 100644 --- a/misc/examples/regex2.c +++ b/misc/examples/regex2.c @@ -10,7 +10,8 @@ int main() {"(https?://|ftp://|www\\.)([0-9A-Za-z@:%_+~#=-]+\\.)+([a-z][a-z][a-z]?)(/[/0-9A-Za-z\\.@:%_+~#=\\?&-]*)?", "https://en.cppreference.com/w/cpp/regex/regex_search" }, - {"!((abc|123)+)!", "!123abcabc!"} + {"!((abc|123)+)!", "!123abcabc!"}, + {"(\\p{L&}+ )+(\\p{Nd}+)", "Großpackung süßigkeiten 199"}, }; c_AUTO (cregex, re) @@ -21,12 +22,11 @@ int main() printf("error in regex pattern: %d\n", res); continue; } - printf("input: %s\n", s[i].input); + printf("\ninput: %s\n", s[i].input); c_FORMATCH (j, &re, s[i].input) { c_FORRANGE (k, cregex_captures(&re)) printf(" submatch %lld: %.*s\n", k, c_ARGSV(j.match[k])); - puts(""); } } } |
