OmniSciDB  04ee39c94c
Regexp.cpp File Reference
#include "Regexp.h"
#include <boost/regex.hpp>
+ Include dependency graph for Regexp.cpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

DEVICE bool regexp_like (const char *str, const int32_t str_len, const char *pattern, const int32_t pat_len, const char escape_char)
 
DEVICE int8_t regexp_like_nullable (const char *str, const int32_t str_len, const char *pattern, const int32_t pat_len, const char escape_char, const int8_t bool_null)
 

Function Documentation

◆ regexp_like()

DEVICE bool regexp_like ( const char *  str,
const int32_t  str_len,
const char *  pattern,
const int32_t  pat_len,
const char  escape_char 
)

Definition at line 40 of file Regexp.cpp.

References run-benchmark-import::result.

Referenced by anonymous_namespace{StringDictionaryProxy.cpp}::is_regexp_like(), anonymous_namespace{StringDictionary.cpp}::is_regexp_like(), regexp_like_nullable(), and TEST().

44  {
45 #ifndef __CUDACC__
46  bool result;
47  try {
48  boost::regex re(pattern, pat_len, boost::regex::extended);
49  boost::cmatch what;
50  result = boost::regex_match(str, str + str_len, what, re);
51  } catch (std::runtime_error& error) {
52  // LOG(ERROR) << "Regexp match error: " << error.what();
53  result = false;
54  }
55  return result;
56 #else
57  return false;
58 #endif
59 }
+ Here is the caller graph for this function:

◆ regexp_like_nullable()

DEVICE int8_t regexp_like_nullable ( const char *  str,
const int32_t  str_len,
const char *  pattern,
const int32_t  pat_len,
const char  escape_char,
const int8_t  bool_null 
)

Definition at line 61 of file Regexp.cpp.

References regexp_like().

66  {
67  if (!str || !pattern) {
68  return bool_null;
69  }
70 
71  return regexp_like(str, str_len, pattern, pat_len, escape_char);
72 }
DEVICE bool regexp_like(const char *str, const int32_t str_len, const char *pattern, const int32_t pat_len, const char escape_char)
Definition: Regexp.cpp:40
+ Here is the call graph for this function: