OmniSciDB  cde582ebc3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Regexp.cpp File Reference
#include "Regexp.h"
#include <stdexcept>
#include "Shared/clean_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

RUNTIME_EXPORT DEVICE bool regexp_like (const char *str, const int32_t str_len, const char *pattern, const int32_t pat_len, const char escape_char)
 
RUNTIME_EXPORT 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

RUNTIME_EXPORT 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 39 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(), and regexp_like_nullable().

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

+ Here is the caller graph for this function:

RUNTIME_EXPORT 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 60 of file Regexp.cpp.

References regexp_like().

65  {
66  if (!str || !pattern) {
67  return bool_null;
68  }
69 
70  return regexp_like(str, str_len, pattern, pat_len, escape_char);
71 }
RUNTIME_EXPORT 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:39

+ Here is the call graph for this function: