Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Macros | Typedefs | Functions
regex.h File Reference
#include <wireshark.h>

Go to the source code of this file.

Macros

#define WS_REGEX_CASELESS   (1U << 0)
 
#define WS_REGEX_NEVER_UTF   (1U << 1)
 
#define WS_REGEX_ANCHORED   (1U << 2)
 

Typedefs

typedef struct _ws_regex ws_regex_t
 

Functions

WS_DLL_PUBLIC ws_regex_tws_regex_compile (const char *patt, char **errmsg)
 
WS_DLL_PUBLIC ws_regex_tws_regex_compile_ex (const char *patt, ssize_t size, char **errmsg, unsigned flags)
 
WS_DLL_PUBLIC bool ws_regex_matches (const ws_regex_t *re, const char *subj)
 
WS_DLL_PUBLIC bool ws_regex_matches_length (const ws_regex_t *re, const char *subj, ssize_t subj_length)
 
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])
 
WS_DLL_PUBLIC void ws_regex_free (ws_regex_t *re)
 
WS_DLL_PUBLIC const char * ws_regex_pattern (const ws_regex_t *re)
 

Detailed Description

Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs

SPDX-License-Identifier: GPL-2.0-or-later

Function Documentation

◆ ws_regex_matches()

WS_DLL_PUBLIC bool ws_regex_matches ( const ws_regex_t re,
const char *  subj 
)

Matches a null-terminated subject string.

◆ ws_regex_matches_length()

WS_DLL_PUBLIC bool ws_regex_matches_length ( const ws_regex_t re,
const char *  subj,
ssize_t  subj_length 
)

Matches a subject string length in 8 bit code units.

◆ ws_regex_matches_pos()

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] 
)

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 first codepoint past the matched substring. pos_vect[1] - pos_vect[0] is the matched substring length.