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 #define WS_REGEX_ANCHORED (1U << 2)
30 
31 WS_DLL_PUBLIC ws_regex_t *
32 ws_regex_compile_ex(const char *patt, ssize_t size, char **errmsg, unsigned flags);
33 
35 WS_DLL_PUBLIC bool
36 ws_regex_matches(const ws_regex_t *re, const char *subj);
37 
39 WS_DLL_PUBLIC bool
41  const char *subj, ssize_t subj_length);
42 
54 WS_DLL_PUBLIC bool
56  const char *subj, ssize_t subj_length,
57  size_t subj_offset, size_t pos_vect[2]);
58 
59 WS_DLL_PUBLIC void
60 ws_regex_free(ws_regex_t *re);
61 
62 WS_DLL_PUBLIC const char *
63 ws_regex_pattern(const ws_regex_t *re);
64 
65 #ifdef __cplusplus
66 }
67 #endif
68 
69 #endif /* __WSUTIL_REGEX_H__ */
WS_DLL_PUBLIC bool ws_regex_matches(const ws_regex_t *re, const char *subj)
Definition: regex.c:144
WS_DLL_PUBLIC bool ws_regex_matches_length(const ws_regex_t *re, const char *subj, ssize_t subj_length)
Definition: regex.c:151
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:170
Definition: regex.c:17