Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
regex.h
Go to the documentation of this file.
1
10#ifndef __WSUTIL_REGEX_H__
11#define __WSUTIL_REGEX_H__
12
13#include <wireshark.h>
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19struct _ws_regex;
20typedef struct _ws_regex ws_regex_t;
21
32WS_DLL_PUBLIC ws_regex_t *ws_regex_compile(const char *patt, char **errmsg);
33
38#define WS_REGEX_CASELESS (1U << 0)
39
44#define WS_REGEX_NEVER_UTF (1U << 1)
45
50#define WS_REGEX_ANCHORED (1U << 2)
51
64WS_DLL_PUBLIC ws_regex_t *ws_regex_compile_ex(const char *patt, ssize_t size, char **errmsg, unsigned flags);
65
75WS_DLL_PUBLIC bool ws_regex_matches(const ws_regex_t *re, const char *subj);
76
87WS_DLL_PUBLIC bool ws_regex_matches_length(const ws_regex_t *re,
88 const char *subj, ssize_t subj_length);
89
110WS_DLL_PUBLIC bool ws_regex_matches_pos(const ws_regex_t *re,
111 const char *subj, ssize_t subj_length,
112 size_t subj_offset, size_t pos_vect[2]);
113
121WS_DLL_PUBLIC void ws_regex_free(ws_regex_t *re);
122
131WS_DLL_PUBLIC const char *ws_regex_pattern(const ws_regex_t *re);
132
133
134#ifdef __cplusplus
135}
136#endif
137
138#endif /* __WSUTIL_REGEX_H__ */
WS_DLL_PUBLIC bool ws_regex_matches(const ws_regex_t *re, const char *subj)
Matches a null-terminated subject string against a compiled regex.
Definition regex.c:144
WS_DLL_PUBLIC bool ws_regex_matches_length(const ws_regex_t *re, const char *subj, ssize_t subj_length)
Matches a subject string of specified length against a compiled regex.
Definition regex.c:151
WS_DLL_PUBLIC ws_regex_t * ws_regex_compile(const char *patt, char **errmsg)
Compiles a regular expression pattern.
Definition regex.c:100
WS_DLL_PUBLIC bool ws_regex_matches_pos(const ws_regex_t *re, const char *subj, ssize_t subj_length, size_t subj_offset, size_t pos_vect[2])
Finds the position of a match within a subject string.
Definition regex.c:170
WS_DLL_PUBLIC ws_regex_t * ws_regex_compile_ex(const char *patt, ssize_t size, char **errmsg, unsigned flags)
Compiles a regular expression with extended options.
Definition regex.c:84
WS_DLL_PUBLIC const char * ws_regex_pattern(const ws_regex_t *re)
Returns the original pattern string from a compiled regex.
Definition regex.c:202
WS_DLL_PUBLIC void ws_regex_free(ws_regex_t *re)
Frees a compiled regex object.
Definition regex.c:193
Definition regex.c:17