diff options
| -rw-r--r-- | docs/cregex_api.md | 2 | ||||
| -rw-r--r-- | examples/regex1.c | 2 | ||||
| -rw-r--r-- | include/stc/cregex.h | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/docs/cregex_api.md b/docs/cregex_api.md index f95b8114..34278905 100644 --- a/docs/cregex_api.md +++ b/docs/cregex_api.md @@ -37,7 +37,7 @@ int cregex_find_sv(csview input, const cregex* re, csview match[]); // takes string pattern instead of re. (for one-time matches) int cregex_find_p(const char* input, const char* pattern, csview match[], int cmflags); -bool cregex_is_match(const char* input, const cregex* re, int mflags); +bool cregex_is_match(const char* input, const cregex* re); cstr cregex_replace(const char* input, const cregex* re, const char* replace, unsigned count); cstr cregex_replace_ex(const char* input, const cregex* re, const char* replace, unsigned count, diff --git a/examples/regex1.c b/examples/regex1.c index 7e8040ac..5981e878 100644 --- a/examples/regex1.c +++ b/examples/regex1.c @@ -22,7 +22,7 @@ int main(int argc, char* argv[]) if (cstr_equals(input, "q")) break; - if (cregex_is_match(cstr_str(&input), &float_expr, 0)) + if (cregex_is_match(cstr_str(&input), &float_expr)) printf("Input is a float\n"); else printf("Invalid input : Not a float\n"); diff --git a/include/stc/cregex.h b/include/stc/cregex.h index 653b0b07..7c4d0a4c 100644 --- a/include/stc/cregex.h +++ b/include/stc/cregex.h @@ -112,8 +112,8 @@ int cregex_find_p(const char* input, const char* pattern, csview match[], int cmflags); static inline -bool cregex_is_match(const char* input, const cregex* re, int mflags) - { return cregex_find(input, re, NULL, mflags) == 1; } +bool cregex_is_match(const char* input, const cregex* re) + { return cregex_find(input, re, NULL, 0) == cre_success; } /* replace regular expression */ cstr cregex_replace_ex(const char* input, const cregex* re, const char* replace, unsigned count, |
