188 errmsg(
"invalid regular expression: %s", errMsg)));
211 for (
int i = 0;
i < nmatch;
i++)
213 pmatch[
i].rm_so = -1;
214 pmatch[
i].rm_eo = -1;
233 errmsg(
"regular expression failed: %s", errMsg)));
413 errmsg(
"invalid regular expression test option: \"%.*s\"",
483 array_len = re_flags->
glob ? 255 : 31;
499 array_len += array_len + 1;
503 errmsg(
"too many regular expression matches")));
505 sizeof(
int) * array_len);
511 int so = pmatch[
i].rm_so;
512 int eo = pmatch[
i].rm_eo;
516 if (
so >= 0 &&
eo >= 0 && (
eo -
so) > maxlen)
533 if (pmatch[0].rm_so == pmatch[0].rm_eo)
548 array_len += array_len + 1;
552 errmsg(
"too many regular expression matches")));
554 sizeof(
int) * array_len);
591 matchctx->conv_bufsiz = conv_bufsiz;
694 bool indices =
matchctx->re_flags.indices;
716 else if (
so < 0 ||
eo < 0)
ArrayType * construct_md_array(Datum *elems, bool *nulls, int ndims, int *dims, int *lbs, Oid elmtype, int elmlen, bool elmbyval, char elmalign)
#define Assert(condition)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define palloc_array(type, count)
#define palloc0_object(type)
#define PG_GETARG_TEXT_PP(n)
#define PG_FUNCTION_INFO_V1(funcname)
#define DirectFunctionCall3(func, arg1, arg2, arg3)
#define PG_GET_COLLATION()
#define PG_GETARG_TEXT_P_COPY(n)
#define SRF_IS_FIRSTCALL()
#define SRF_PERCALL_SETUP()
#define SRF_RETURN_NEXT(_funcctx, _result)
#define SRF_FIRSTCALL_INIT()
#define SRF_RETURN_DONE(_funcctx)
int pg_wchar2mb_with_len(const pg_wchar *from, char *to, int len)
int pg_database_encoding_max_length(void)
int pg_mb2wchar_with_len(const char *from, pg_wchar *to, int len)
int pg_mblen(const char *mbstr)
void * repalloc(void *pointer, Size size)
void pfree(void *pointer)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
static AmcheckOptions opts
static char buf[DEFAULT_XLOG_SEG_SIZE]
static Datum PointerGetDatum(const void *X)
static Datum Int32GetDatum(int32 X)
int pg_regcomp(regex_t *re, const chr *string, size_t len, int flags, Oid collation)
size_t pg_regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)
int pg_regexec(regex_t *re, const chr *string, size_t len, size_t search_start, rm_detail_t *details, size_t nmatch, regmatch_t pmatch[], int flags)
void pg_regfree(regex_t *re)
static test_regex_ctx * setup_test_matches(text *orig_str, regex_t *cpattern, test_re_flags *re_flags, Oid collation, bool use_subpatterns)
static void test_re_compile(text *text_re, int cflags, Oid collation, regex_t *result_re)
static ArrayType * build_test_match_result(test_regex_ctx *matchctx)
static bool test_re_execute(regex_t *re, pg_wchar *data, int data_len, int start_search, rm_detail_t *details, int nmatch, regmatch_t *pmatch, int eflags)
Datum test_regex(PG_FUNCTION_ARGS)
static void parse_test_flags(test_re_flags *flags, text *opts)
static ArrayType * build_test_info_result(regex_t *cpattern, test_re_flags *flags)
static Size VARSIZE_ANY_EXHDR(const void *PTR)
static char * VARDATA_ANY(const void *PTR)
Datum bit(PG_FUNCTION_ARGS)
Datum text_substr(PG_FUNCTION_ARGS)
text * cstring_to_text_with_len(const char *s, int len)
text * cstring_to_text(const char *s)