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

`match` overloads

== Synopses

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

Match the specified `subject` against `pattern()`&period; Begin matching at the optionally specified `subjectOffset` in `subject`&period; If `subjectOffset` is not specified, matching begins at the start of `subject`&period; UTF&hyphen;8 validity checking is performed on `subject` if `pattern()` was prepared with `k&lowbar;FLAG&lowbar;UTF8`&period; Return `k&lowbar;STATUS&lowbar;SUCCESS` on success, `k&lowbar;STATUS&lowbar;NO&lowbar;MATCH` if a match is not found, and another value if an error occurs&period; If the returned status is not `k&lowbar;STATUS&lowbar;SUCCESS` or `k&lowbar;STATUS&lowbar;NO&lowbar;MATCH` it may match one of specific `k&lowbar;STATUS&lowbar;&ast;` error return constants defined above (but is not guaranteed to)&period; The behavior is undefined unless `true &equals;&equals; isPrepared()` and `subjectOffset &lt;&equals; subject&period;length()`&period; Note that JIT optimization is disabled if `pattern()` was prepared with `k&lowbar;FLAG&lowbar;UTF8`&semi; use `matchRaw` if JIT is preferred and UTF&hyphen;8 validation of `subject` is not required&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
xref:BloombergLP/bdlpcre/RegEx/match-0b.adoc[match](
    std::string&lowbar;view const& subject,
    size&lowbar;t subjectOffset = 0) const;
----

[.small]#xref:BloombergLP/bdlpcre/RegEx/match-0b.adoc[_» more&period;&period;&period;_]#

Match the specified `subject` against `pattern()`&period; Begin matching at the optionally specified `subjectOffset` in `subject`&period; If `subjectOffset` is not specified, matching begins at the start of `subject`&period; UTF&hyphen;8 validity checking is performed on `subject` if `pattern()` was prepared with `k&lowbar;FLAG&lowbar;UTF8`&period; Return `k&lowbar;STATUS&lowbar;SUCCESS` on success, `k&lowbar;STATUS&lowbar;NO&lowbar;MATCH` if a match is not found, and another value if an error occurs&period; If the returned status is not `k&lowbar;STATUS&lowbar;SUCCESS` or `k&lowbar;STATUS&lowbar;NO&lowbar;MATCH` it may match one of specific `k&lowbar;STATUS&lowbar;&ast;` error return constants defined above (but is not guaranteed to)&period; `result` is unchanged if a value other than `k&lowbar;STATUS&lowbar;SUCCESS` is returned&period; The behavior is undefined unless `true &equals;&equals; isPrepared()` and `subjectOffset &lt;&equals; subject&period;length()`&period; Note that JIT optimization is disabled if `pattern()` was prepared with `k&lowbar;FLAG&lowbar;UTF8`&semi; use `matchRaw` if JIT is preferred and UTF&hyphen;8 validation of `subject` is not required&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
xref:BloombergLP/bdlpcre/RegEx/match-00.adoc[match](
    std::string&lowbar;view* result,
    std::string&lowbar;view const& subject,
    size&lowbar;t subjectOffset = 0) const;
----

[.small]#xref:BloombergLP/bdlpcre/RegEx/match-00.adoc[_» more&period;&period;&period;_]#

Match `subject` against `pattern()`, loading subpattern matches into `result`&period; Begin matching at the optionally specified `subjectOffset`&period; UTF&hyphen;8 validity checking is performed on `subject` if `pattern()` was prepared with `k&lowbar;FLAG&lowbar;UTF8`&period; Return `k&lowbar;STATUS&lowbar;SUCCESS` on success&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
xref:BloombergLP/bdlpcre/RegEx/match-03.adoc[match](
    xref:bsl/vector-00d.adoc[bsl::vector&lt;std::string&lowbar;view&gt;]* result,
    std::string&lowbar;view const& subject,
    size&lowbar;t subjectOffset = 0) const;
----

[.small]#xref:BloombergLP/bdlpcre/RegEx/match-03.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, using a `std&colon;&colon;pmr&colon;&colon;vector` buffer&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
xref:BloombergLP/bdlpcre/RegEx/match-0c.adoc[match](
    std::pmr::vector&lt;std::string&lowbar;view&gt;* result,
    std::string&lowbar;view const& subject,
    size&lowbar;t subjectOffset = 0) const;
----

[.small]#xref:BloombergLP/bdlpcre/RegEx/match-0c.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, using a `std&colon;&colon;vector` result buffer&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
xref:BloombergLP/bdlpcre/RegEx/match-04.adoc[match](
    std::vector&lt;std::string&lowbar;view&gt;* result,
    std::string&lowbar;view const& subject,
    size&lowbar;t subjectOffset = 0) const;
----

[.small]#xref:BloombergLP/bdlpcre/RegEx/match-04.adoc[_» more&period;&period;&period;_]#

Match the specified `subject` having the specified `subjectLength` against `pattern()`&period; Begin matching at the optionally specified `subjectOffset` in `subject`&period; If `subjectOffset` is not specified, matching begins at the start of `subject`&period; `subject` may contain embedded null characters&period; UTF&hyphen;8 validity checking is performed on `subject` if `pattern()` was prepared with `k&lowbar;FLAG&lowbar;UTF8`&period; Return `k&lowbar;STATUS&lowbar;SUCCESS` on success, `k&lowbar;STATUS&lowbar;NO&lowbar;MATCH` if a match is not found, and another value if an error occurs&period; If the returned status is not `k&lowbar;STATUS&lowbar;SUCCESS` or `k&lowbar;STATUS&lowbar;NO&lowbar;MATCH` it may match one of specific `k&lowbar;STATUS&lowbar;&ast;` error return constants defined above (but is not guaranteed to)&period; The behavior is undefined unless `true &equals;&equals; isPrepared()`, `subject &verbar;&verbar; 0 &equals;&equals; subjectLength`, and `subjectOffset &lt;&equals; subjectLength`&period; Note that JIT optimization is disabled if `pattern()` was prepared with `k&lowbar;FLAG&lowbar;UTF8`&semi; use `matchRaw` if JIT is preferred and UTF&hyphen;8 validation of `subject` is not required&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
xref:BloombergLP/bdlpcre/RegEx/match-099.adoc[match](
    char const* subject,
    size&lowbar;t subjectLength,
    size&lowbar;t subjectOffset = 0) const;
----

[.small]#xref:BloombergLP/bdlpcre/RegEx/match-099.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, loading a `string&lowbar;view` match result&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
xref:BloombergLP/bdlpcre/RegEx/match-02.adoc[match](
    std::string&lowbar;view* result,
    char const* subject,
    size&lowbar;t subjectLength,
    size&lowbar;t subjectOffset = 0) const;
----

[.small]#xref:BloombergLP/bdlpcre/RegEx/match-02.adoc[_» more&period;&period;&period;_]#

Match the specified `subject` having the specified `subjectLength` against `pattern()`&period; Begin matching at the optionally specified `subjectOffset` in `subject`&period; If `subjectOffset` is not specified, matching begins at the start of `subject`&period; `subject` may contain embedded null characters&period; UTF&hyphen;8 validity checking is performed on `subject` if `pattern()` was prepared with `k&lowbar;FLAG&lowbar;UTF8`&period; Return `k&lowbar;STATUS&lowbar;SUCCESS` on success, `k&lowbar;STATUS&lowbar;NO&lowbar;MATCH` if a match is not found, and another value if an error occurs&period; If the returned status is not `k&lowbar;STATUS&lowbar;SUCCESS` or `k&lowbar;STATUS&lowbar;NO&lowbar;MATCH` it may match one of specific `k&lowbar;STATUS&lowbar;&ast;` error return constants defined above (but is not guaranteed to)&period; `result` is unchanged if a value other than `k&lowbar;STATUS&lowbar;SUCCESS` is returned&period; The behavior is undefined unless `true &equals;&equals; isPrepared()`, `subject &verbar;&verbar; 0 &equals;&equals; subjectLength`, and `subjectOffset &lt;&equals; subjectLength`&period; Note that JIT optimization is disabled if `pattern()` was prepared with `k&lowbar;FLAG&lowbar;UTF8`&semi; use `matchRaw` if JIT is preferred and UTF&hyphen;8 validation of `subject` is not required&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
xref:BloombergLP/bdlpcre/RegEx/match-096.adoc[match](
    xref:bsl/pair-0b.adoc[bsl::pair&lt;size&lowbar;t, size&lowbar;t&gt;]* result,
    char const* subject,
    size&lowbar;t subjectLength,
    size&lowbar;t subjectOffset = 0) const;
----

[.small]#xref:BloombergLP/bdlpcre/RegEx/match-096.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, loading `StringRef` match results&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
xref:BloombergLP/bdlpcre/RegEx/match-09f.adoc[match](
    xref:bsl/vector-00d.adoc[bsl::vector&lt;bslstl::StringRef&gt;]* result,
    char const* subject,
    size&lowbar;t subjectLength,
    size&lowbar;t subjectOffset = 0) const;
----

[.small]#xref:BloombergLP/bdlpcre/RegEx/match-09f.adoc[_» more&period;&period;&period;_]#

Match the specified `subject` having the specified `subjectLength` against `pattern()`&period; Begin matching at the optionally specified `subjectOffset` in `subject`&period; If `subjectOffset` is not specified, matching begins at the start of `subject`&period; `subject` may contain embedded null characters&period; UTF&hyphen;8 validity checking is performed on `subject` if `pattern()` was prepared with `k&lowbar;FLAG&lowbar;UTF8`&period; On success&colon;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
xref:BloombergLP/bdlpcre/RegEx/match-0d.adoc[match](
    xref:bsl/vector-00d.adoc[bsl::vector&lt;bsl::pair&lt;size&lowbar;t, size&lowbar;t&gt;&gt;]* result,
    char const* subject,
    size&lowbar;t subjectLength,
    size&lowbar;t subjectOffset = 0) const;
----

[.small]#xref:BloombergLP/bdlpcre/RegEx/match-0d.adoc[_» more&period;&period;&period;_]#


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