aboutsummaryrefslogtreecommitdiff
path: root/src/regex-match.c
blob: d59bee70ecd1d6754dbd052b13575f683464bf4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// regex-match.c --- match string against a pattern using regex
// Usage: regex-match string
#include <stdlib.h>
#include <stdio.h>
#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