From 3f36aca66e1ac6c872300059e8db691a473614d4 Mon Sep 17 00:00:00 2001 From: Martin Michalec Date: Sun, 8 Nov 2026 08:23:31 +0300 Subject: publish --- src/regex-match.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/regex-match.c (limited to 'src/regex-match.c') diff --git a/src/regex-match.c b/src/regex-match.c new file mode 100644 index 0000000..d59bee7 --- /dev/null +++ b/src/regex-match.c @@ -0,0 +1,21 @@ +// regex-match.c --- match string against a pattern using regex +// Usage: regex-match string +#include +#include +#include "regex.h" + +int +main (int argc, char *argv[]) +{ + const char *progname = *argv++; + + if (argc != 2) { + fprintf (stderr, "Usage: %s string\n", progname); + return EXIT_FAILURE; + } + + const char *string = *argv++; + + return regex_match (string); +} +// regex-match.c ends here -- cgit v1.3.1