Prepare this regular‐expression object with the specified pattern and the optionally specified flags. flags, if supplied, should contain a bit‐wise or of the k_FLAG_* constants defined by this class, which indicate additional configuration parameters for the regular expression. Optionally specify jitStackSize. If flags has the k_FLAG_JIT flag set, jitStackSize indicates the size of the allocated JIT stack to be used for this pattern. If flags has the k_FLAG_JIT bit set and jitStackSize is 0 (or not supplied), no memory will be allocated for the JIT stack and the program stack will be used as the JIT stack. If flags does not have k_FLAG_JIT set, or isJitAvailable() is false, the jitStackSize parameter, if supplied, is ignored. On success, put this object into the "prepared" state and return 0, with no effect on the specified errorMessage and errorOffset. Otherwise, (1) put this object into the "unprepared" state, (2) load errorMessage (if non‐null) with a string describing the error detected, (3) load errorOffset (if non‐null) with the offset in pattern at which the error was detected, and (4) return a non‐zero value. The behavior is undefined unless flags is the bit‐wise inclusive‐or of 0 or more of the following values: ` k_FLAG_CASELESS k_FLAG_DOTMATCHESALL k_FLAG_MULTILINE k_FLAG_UTF8 k_FLAG_JIT k_FLAG_DUPNAMES ` Note that the flag k_FLAG_JIT is ignored if isJitAvailable() is false.
Synopsis
Declared in <bdlpcre_regex.h>
template<class STRING>
int
prepare(
STRING* errorMessage,
size_t* errorOffset,
char const* pattern,
int flags = 0,
size_t jitStackSize = 0)
requires bsl::is_same<STRING, bsl::string>::value
|| bsl::is_same<STRING, std::string>::value
#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING
|| bsl::is_same<STRING, std::pmr::string>::value;
Created with MrDocs