summaryrefslogtreecommitdiff
path: root/lib/regex.h
diff options
context:
space:
mode:
authorTyler Murphy <tylerm@tylerm.dev>2023-05-14 21:43:02 -0400
committerTyler Murphy <tylerm@tylerm.dev>2023-05-14 21:43:02 -0400
commite735ad6710a82604a206ad29f6cbcdd7dc4b024c (patch)
tree5fe8eebbb7a2bff20bb71bd2368955356979e0a2 /lib/regex.h
parentsync (diff)
downloadlazysphere-e735ad6710a82604a206ad29f6cbcdd7dc4b024c.tar.gz
lazysphere-e735ad6710a82604a206ad29f6cbcdd7dc4b024c.tar.bz2
lazysphere-e735ad6710a82604a206ad29f6cbcdd7dc4b024c.zip
refactor and add su
Diffstat (limited to 'lib/regex.h')
-rw-r--r--lib/regex.h54
1 files changed, 0 insertions, 54 deletions
diff --git a/lib/regex.h b/lib/regex.h
deleted file mode 100644
index d4c61b6..0000000
--- a/lib/regex.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * Mini regex-module inspired by Rob Pike's regex code described in:
- *
- * http://www.cs.princeton.edu/courses/archive/spr09/cos333/beautiful.html
- *
- *
- *
- * Supports:
- * ---------
- * '.' Dot, matches any character
- * '^' Start anchor, matches beginning of string
- * '$' End anchor, matches end of string
- * '*' Asterisk, match zero or more (greedy)
- * '+' Plus, match one or more (greedy)
- * '?' Question, match zero or one (non-greedy)
- * '[abc]' Character class, match if one of {'a', 'b', 'c'}
- * '[^abc]' Inverted class, match if NOT one of {'a', 'b', 'c'} -- NOTE: feature is currently broken!
- * '[a-zA-Z]' Character ranges, the character set of the ranges { a-z | A-Z }
- * '\s' Whitespace, \t \f \r \n \v and spaces
- * '\S' Non-whitespace
- * '\w' Alphanumeric, [a-zA-Z0-9_]
- * '\W' Non-alphanumeric
- * '\d' Digits, [0-9]
- * '\D' Non-digits
- *
- *
- */
-
-#ifndef _TINY_REGEX_C
-#define _TINY_REGEX_C
-
-
-#ifndef RE_DOT_MATCHES_NEWLINE
-/* Define to 0 if you DON'T want '.' to match '\r' + '\n' */
-#define RE_DOT_MATCHES_NEWLINE 1
-#endif
-
-/* Typedef'd pointer to get abstract datatype. */
-typedef struct regex_t* re_t;
-
-/* Compile regex string pattern to a regex_t-array. */
-re_t re_compile(const char* pattern);
-
-
-/* Find matches of the compiled pattern inside text. */
-int re_matchp(re_t pattern, const char* text, int* matchlength);
-
-
-/* Find matches of the txt pattern inside text (will compile automatically first). */
-int re_match(const char* pattern, const char* text, int* matchlength);
-
-
-#endif /* ifndef _TINY_REGEX_C */