diff options
author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2022-09-22 15:44:39 +0800 |
---|---|---|
committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2022-09-22 15:44:39 +0800 |
commit | 8bdec864ad952aa34db5357a90b840e69e17895f (patch) | |
tree | 75b2dd2f526ed8a8eae0e3865493f81870d57d3e /regex.h | |
parent | f2ad5c75a80c35bb2fc9023cd0fb09a29d428491 (diff) |
Merge regex.h
Diffstat (limited to 'regex.h')
-rw-r--r-- | regex.h | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/regex.h b/regex.h deleted file mode 100644 index ebd51ac..0000000 --- a/regex.h +++ /dev/null @@ -1,17 +0,0 @@ -#define PCRE2_CODE_UNIT_WIDTH 8 -#include <pcre2.h> - -static inline bool regex_match(const char *shop) -{ - pcre2_code *re = pcre2_compile((PCRE2_SPTR) - "^[a-zA-Z0-9][a-zA-Z0-9\\-]*\\.myshopify\\.com", - PCRE2_ZERO_TERMINATED, 0, &(int){ 0 }, - &(PCRE2_SIZE){ 0 }, NULL); - pcre2_match_data *match_data - = pcre2_match_data_create_from_pattern(re, NULL); - int rc = pcre2_match(re, (PCRE2_SPTR)shop, strlen(shop), 0, 0, - match_data, NULL); - pcre2_match_data_free(match_data); - pcre2_code_free(re); - return rc >= 0; -} |