From 3d51ee82115b8e6e619ba817ba8d48672c413845 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Thu, 22 Sep 2022 14:02:37 +0800 Subject: Merge regex.h, as it's only called 1 time --- regex.h | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 regex.h (limited to 'regex.h') 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 - -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; -} -- cgit v1.2.3