[#BloombergLP-bdlpcre-RegEx-prepare-08] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlpcre.adoc[bdlpcre]::xref:BloombergLP/bdlpcre/RegEx.adoc[RegEx]::prepare :relfileprefix: ../../../ :mrdocs: `prepare` overloads == Synopses Declared in `<bdlpcre_regex.h>` Prepare this regular‐expression object with the specified `pattern`, discarding compile‐error text (pass a null `errorMessage`). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int xref:BloombergLP/bdlpcre/RegEx/prepare-0e.adoc[prepare]( xref:bsl/nullptr_t-08.adoc[bsl::nullptr_t] errorMessage, size_t* errorOffset, char const* pattern, int flags = 0, size_t jitStackSize = 0); ---- [.small]#xref:BloombergLP/bdlpcre/RegEx/prepare-0e.adoc[_» more..._]# 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`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class STRING> int xref:BloombergLP/bdlpcre/RegEx/prepare-06.adoc[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; ---- [.small]#xref:BloombergLP/bdlpcre/RegEx/prepare-06.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#