[#BloombergLP-bdlpcre-RegEx]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlpcre.adoc[bdlpcre]::RegEx
:relfileprefix: ../../
:mrdocs:

Mechanism for compiling and matching regular expressions&period;

== Synopsis

Declared in `&lt;bdlpcre&lowbar;regex&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class RegEx;
----

== Description

This class provides a mechanism for compiling and matching regular expressions&period; A regular expression approximately compatible with Perl 5&period;10 is compiled with the `prepare` method&period; Subsequently, strings are matched against the compiled (prepared) pattern using the overloaded `match` and `matchRaw` methods&period; Note that the underlying implementation uses the open&hyphen;source Perl Compatible Regular Expressions (PCRE2) library that was developed at the University of Cambridge (`http&colon;&sol;&sol;www&period;pcre&period;org&sol;`)&period;

== Enums

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlpcre/RegEx/_04enum-07.adoc[`Unnamed enum`] 
| Flags that may be supplied to `prepare` to affect matching behavior&period;
| xref:BloombergLP/bdlpcre/RegEx/_04enum-0e.adoc[`Unnamed enum`] 
| Flags that may be supplied to `replace` to affect replacement behavior&period;
| xref:BloombergLP/bdlpcre/RegEx/_04enum-02.adoc[`Unnamed enum`] 
| Status codes distinguishing among results of match operations&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlpcre/RegEx/2constructor.adoc[`RegEx`]         [.small]#[constructor]#
| Create a regular&hyphen;expression object in the &quot;unprepared&quot; state&period;
| xref:BloombergLP/bdlpcre/RegEx/2destructor.adoc[`&#126;RegEx`] [.small]#[destructor]#
| Destroy this regular&hyphen;expression object&period;
| xref:BloombergLP/bdlpcre/RegEx/clear.adoc[`clear`] 
| Free resources and put this object into the &quot;unprepared&quot; state&period;
| xref:BloombergLP/bdlpcre/RegEx/depthLimit.adoc[`depthLimit`] 
| Return the evaluation recursion depth limit for this regular&hyphen;expression object&period;
| xref:BloombergLP/bdlpcre/RegEx/flags.adoc[`flags`] 
| Return the flags from the most recent successful `prepare` call&period;
| xref:BloombergLP/bdlpcre/RegEx/isPrepared.adoc[`isPrepared`] 
| Return `true` if this regular&hyphen;expression object is in the &quot;prepared&quot; state, and `false` otherwise&period;
| xref:BloombergLP/bdlpcre/RegEx/jitStackSize.adoc[`jitStackSize`] 
| Return the explicitly configured JIT stack size, or 0&period;
| xref:BloombergLP/bdlpcre/RegEx/match-08.adoc[`match`] 
| `match` overloads
| xref:BloombergLP/bdlpcre/RegEx/matchRaw-088.adoc[`matchRaw`] 
| `matchRaw` overloads
| xref:BloombergLP/bdlpcre/RegEx/namedSubpatterns-05.adoc[`namedSubpatterns`] 
| `namedSubpatterns` overloads
| xref:BloombergLP/bdlpcre/RegEx/numSubpatterns.adoc[`numSubpatterns`] 
| Return the number of sub&hyphen;patterns in the pattern held by this regular&hyphen;expression object (`pattern()`)&period; The behavior is undefined unless `isPrepared() &equals;&equals; true`&period;
| xref:BloombergLP/bdlpcre/RegEx/pattern.adoc[`pattern`] 
| Return a reference to the non&hyphen;modifiable pattern held by this regular&hyphen;expression object&period; The behavior is undefined unless `isPrepared() &equals;&equals; true`&period;
| xref:BloombergLP/bdlpcre/RegEx/prepare-08.adoc[`prepare`] 
| `prepare` overloads
| xref:BloombergLP/bdlpcre/RegEx/replace-05.adoc[`replace`] 
| `replace` overloads
| xref:BloombergLP/bdlpcre/RegEx/replaceRaw-0fe.adoc[`replaceRaw`] 
| `replaceRaw` overloads
| xref:BloombergLP/bdlpcre/RegEx/setDepthLimit.adoc[`setDepthLimit`] 
| Set the evaluation recursion depth limit for this object&period;
| xref:BloombergLP/bdlpcre/RegEx/subpatternIndex.adoc[`subpatternIndex`] 
| Return the 1&hyphen;based index of the named sub&hyphen;pattern, or &hyphen;1&period;
| xref:BloombergLP/bdlpcre/RegEx/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;RegEx, UsesBslmaAllocator&gt;`] 
| Declare that this type uses a `bslma` allocator&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlpcre/RegEx/defaultDepthLimit.adoc[`defaultDepthLimit`] 
| Return the process&hyphen;wide default evaluation recursion depth limit&period;
| xref:BloombergLP/bdlpcre/RegEx/isJitAvailable.adoc[`isJitAvailable`] 
| Return whether just&hyphen;in&hyphen;time compiling is supported on this platform&period;
| xref:BloombergLP/bdlpcre/RegEx/setDefaultDepthLimit.adoc[`setDefaultDepthLimit`] 
| Set the process&hyphen;wide default evaluation recursion depth limit&period;
|===


== Static Data Members

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlpcre/RegEx/k_INVALID_OFFSET.adoc[`k&lowbar;INVALID&lowbar;OFFSET`] 
| Value used to denote an invalid offset for match methods returning pairs&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
