aboutsummaryrefslogtreecommitdiff
path: root/text-regex.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-01-13 12:26:42 +0100
committerMarc André Tanner <mat@brain-dump.org>2017-01-13 12:26:42 +0100
commit42d169f374f14595c52c523b40c97dc90707c46f (patch)
treeafa92351d2e8764fbf236b2dae8a77bd99089c5e /text-regex.c
parent4597e40a10ac80362b349a3abb5027349443d726 (diff)
downloadvis-42d169f374f14595c52c523b40c97dc90707c46f.tar.gz
vis-42d169f374f14595c52c523b40c97dc90707c46f.tar.xz
text-regex: add text_regex_nsub to get number of sub expressions
Diffstat (limited to 'text-regex.c')
-rw-r--r--text-regex.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/text-regex.c b/text-regex.c
index dd541d7..439c24a 100644
--- a/text-regex.c
+++ b/text-regex.c
@@ -23,6 +23,12 @@ int text_regex_compile(Regex *regex, const char *string, int cflags) {
return r;
}
+size_t text_regex_nsub(Regex *r) {
+ if (!r)
+ return 0;
+ return r->regex.re_nsub;
+}
+
void text_regex_free(Regex *r) {
if (!r)
return;