diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:26 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:26 +0000 |
commit | c4e8a3222648fcf22ca207f1815ebbf7cd144eeb (patch) | |
tree | 93d5c6aa93d9987680dd1adad5685e2ad698f223 /wsutil/regex.h | |
parent | Adding upstream version 4.2.6. (diff) | |
download | wireshark-c4e8a3222648fcf22ca207f1815ebbf7cd144eeb.tar.xz wireshark-c4e8a3222648fcf22ca207f1815ebbf7cd144eeb.zip |
Adding upstream version 4.4.0.upstream/4.4.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | wsutil/regex.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/wsutil/regex.h b/wsutil/regex.h index 0484eab3..199779a2 100644 --- a/wsutil/regex.h +++ b/wsutil/regex.h @@ -26,6 +26,7 @@ ws_regex_compile(const char *patt, char **errmsg); /* By default UTF-8 is off. This option also prevents it from being * turned on using a pattern option. */ #define WS_REGEX_NEVER_UTF (1U << 1) +#define WS_REGEX_ANCHORED (1U << 2) WS_DLL_PUBLIC ws_regex_t * ws_regex_compile_ex(const char *patt, ssize_t size, char **errmsg, unsigned flags); @@ -41,14 +42,19 @@ ws_regex_matches_length(const ws_regex_t *re, /** Returns start and end position of the matched substring. * + * @note Using a nonzero subj_offset produces different results than + * passing a pointer to the later offset as subj when the pattern + * begins with a lookbehind. + * * pos_vect[0] is first codepoint in the matched substring. - * pos_vect[1] is the next to last codepoint in the matched substring. + * pos_vect[1] is first codepoint past the matched substring. * pos_vect[1] - pos_vect[0] is the matched substring length. + * */ WS_DLL_PUBLIC bool ws_regex_matches_pos(const ws_regex_t *re, const char *subj, ssize_t subj_length, - size_t pos_vect[2]); + size_t subj_offset, size_t pos_vect[2]); WS_DLL_PUBLIC void ws_regex_free(ws_regex_t *re); |