#include <stdio.h>
#include <string.h>
#include <regex.h>
int match(const char *string, const char *pattern) {
regex_t regex;
int result;
regcomp(®ex, pattern, REG_EXTENDED);
result = regexec(®ex, string, 0, NULL, 0);
regfree(®ex);
return result == 0;
}
int main() {
const char *s = "It's only $20.00 today";
int matchFound = match(s, "\\$");
printf("%d\n", matchFound);
return 0;
}
/*
run:
1
*/