Wireshark  4.3.0
The Wireshark network protocol analyzer
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
16 extern "C" {
17 #endif
18 
19 struct _ws_regex;
20 typedef struct _ws_regex ws_regex_t;
21 
22 WS_DLL_PUBLIC ws_regex_t *
23 ws_regex_compile(const char *patt, char **errmsg);
24 
25 #define WS_REGEX_CASELESS (1U << 0)
26 /* By default UTF-8 is off. This option also prevents it from being
27  * turned on using a pattern option. */
28 #define WS_REGEX_NEVER_UTF (1U << 1)
29 
30 WS_DLL_PUBLIC ws_regex_t *
31 ws_regex_compile_ex(const char *patt, ssize_t size, char **errmsg, unsigned flags);
32 
34 WS_DLL_PUBLIC bool
35 ws_regex_matches(const ws_regex_t *re, const char *subj);
36 
38 WS_DLL_PUBLIC bool
40  const char *subj, ssize_t subj_length);
41 
53 WS_DLL_PUBLIC bool
55  const char *subj, ssize_t subj_length,
56  size_t subj_offset, size_t pos_vect[2]);
57 
58 WS_DLL_PUBLIC void
59 ws_regex_free(ws_regex_t *re);
60 
61 WS_DLL_PUBLIC const char *
62 ws_regex_pattern(const ws_regex_t *re);
63 
64 #ifdef __cplusplus
65 }
66 #endif
67 
68 #endif /* __WSUTIL_REGEX_H__ */
WS_DLL_PUBLIC bool ws_regex_matches(const ws_regex_t *re, const char *subj)
Definition: regex.c:142
WS_DLL_PUBLIC bool ws_regex_matches_length(const ws_regex_t *re, const char *subj, ssize_t subj_length)
Definition: regex.c:149
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])
Definition: regex.c:168
Definition: regex.c:17