Bincimap
2.0.16
Easy Imapping
Loading...
Searching...
No Matches
2.0
bincimap-2.0.16
src
regmatch.cc
Go to the documentation of this file.
1
7
#include "
regmatch.h
"
8
#include <string>
9
10
#include <sys/types.h>
11
#include <regex.h>
12
#include <stdio.h>
13
14
using namespace
::std;
15
16
//------------------------------------------------------------------------
17
int
Binc::regexMatch
(
const
string
&data_in,
const
string
&p_in)
18
{
19
regex_t r;
20
regmatch_t rm[2];
21
22
if
(regcomp(&r, p_in.c_str(), REG_EXTENDED | REG_NOSUB) != 0)
23
return
2;
24
25
int
n = regexec(&r, data_in.c_str(), data_in.length(), rm, 0);
26
regfree(&r);
27
if
(n == 0)
28
return
0;
29
else
30
return
2;
31
}
Binc::regexMatch
int regexMatch(const std::string &data_in, const std::string &p_in)
regmatch.h
Generated on Sun Sep 1 2024 12:00:02 for Bincimap by
1.9.6