Initial commit, yay

This commit is contained in:
VegOwOtenks 2024-06-13 15:28:21 +02:00
commit 25e26756cd
85 changed files with 7077 additions and 0 deletions

29
src/regex/match_struct.h Normal file
View file

@ -0,0 +1,29 @@
#ifndef UTILITIEC_REGEX_MATCHSTRUCT_H
#define UTILITIEC_REGEX_MATCHSTRUCT_H
#include "../StringView/StringView.h"
#include "../dynamicarray/dynamicarray.h"
typedef struct RegexCapture_s {
// potentially unowned string, depending on Regex Options
char* name;
size_t number;
// Reference to string passed to match()
StringView match;
size_t match_start;
size_t match_end;
} RegexCapture;
typedef struct RegexMatch_s {
// entire match
StringView match;
// numbered and named captures intermixed, ordered
DynamicArray captures;
} RegexMatch;
bool RegexMatch_HaveNumberedCapture(RegexMatch* match, size_t number);
RegexCapture* RegexMatch_GetNumberedCapture(RegexMatch* match, size_t number);
#endif