cfengine  3.15.4
About: CFEngine is a configuration management system for configuring and maintaining Unix-like computers (using an own high level policy language). Community version.
  Fossies Dox: cfengine-3.15.4.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

regex.h File Reference
#include <stdbool.h>
#include <pcre.h>
#include <sequence.h>
Include dependency graph for regex.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CFENGINE_REGEX_WHITESPACE_IN_CONTEXTS   ".*[_A-Za-z0-9][ \\t]+[_A-Za-z0-9].*"
 

Functions

pcre * CompileRegex (const char *regex)
 
bool StringMatch (const char *regex, const char *str, int *start, int *end)
 
bool StringMatchWithPrecompiledRegex (pcre *regex, const char *str, int *start, int *end)
 
bool StringMatchFull (const char *regex, const char *str)
 
bool StringMatchFullWithPrecompiledRegex (pcre *regex, const char *str)
 
SeqStringMatchCaptures (const char *regex, const char *str, const bool return_names)
 
SeqStringMatchCapturesWithPrecompiledRegex (const pcre *pattern, const char *str, const bool return_names)
 
bool CompareStringOrRegex (const char *value, const char *compareTo, bool regex)
 
bool RegexPartialMatch (const pcre *rx, const char *teststring)
 

Macro Definition Documentation

◆ CFENGINE_REGEX_WHITESPACE_IN_CONTEXTS

#define CFENGINE_REGEX_WHITESPACE_IN_CONTEXTS   ".*[_A-Za-z0-9][ \\t]+[_A-Za-z0-9].*"

Definition at line 34 of file regex.h.

Function Documentation

◆ CompareStringOrRegex()

bool CompareStringOrRegex ( const char *  value,
const char *  compareTo,
bool  regex 
)

Definition at line 255 of file regex.c.

References NULL_OR_EMPTY, and StringMatchFull().

◆ CompileRegex()

◆ RegexPartialMatch()

bool RegexPartialMatch ( const pcre *  rx,
const char *  teststring 
)

Definition at line 278 of file regex.c.

References NULL, and STRING_MATCH_OVECCOUNT.

Referenced by GenericAgentShowContextsFormatted(), and GenericAgentShowVariablesFormatted().

◆ StringMatch()

bool StringMatch ( const char *  regex,
const char *  str,
int *  start,
int *  end 
)

Definition at line 90 of file regex.c.

References CompileRegex(), NULL, and StringMatchWithPrecompiledRegex().

Referenced by SelectProcRegexMatch().

◆ StringMatchCaptures()

Seq* StringMatchCaptures ( const char *  regex,
const char *  str,
const bool  return_names 
)

Definition at line 232 of file regex.c.

References NULL, and StringMatchCapturesWithPrecompiledRegex().

Referenced by FnCallFormat(), FnCallRegExtract(), and LookupVarRefToJson().

◆ StringMatchCapturesWithPrecompiledRegex()

Seq* StringMatchCapturesWithPrecompiledRegex ( const pcre *  pattern,
const char *  str,
const bool  return_names 
)

◆ StringMatchFull()

◆ StringMatchFullWithPrecompiledRegex()

◆ StringMatchWithPrecompiledRegex()

bool StringMatchWithPrecompiledRegex ( pcre *  regex,
const char *  str,
int *  start,
int *  end 
)

Definition at line 55 of file regex.c.

References NULL, and STRING_MATCH_OVECCOUNT.

Referenced by StringMatch(), StringMatchFullWithPrecompiledRegex(), and StripPatterns().