[#BloombergLP-bdlpcre-RegEx-subpatternIndex] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlpcre.adoc[bdlpcre]::xref:BloombergLP/bdlpcre/RegEx.adoc[RegEx]::subpatternIndex :relfileprefix: ../../../ :mrdocs: Return the 1‐based index of the sub‐pattern having the specified `name` in the pattern held by this regular‐expression object (`pattern()`); return ‐1 if `pattern()` does not contain a sub‐pattern identified by `name` or `name` is not unique. The behavior is undefined unless `isPrepared() == true`. Note that the returned value is intended to be used as an index into the `bsl::vector<bsl::pair<int, int> >` returned by `match`. Also note that the function `namedSubpatterns` can be used to find the sub‐pattern index when there are duplicate named sub‐patterns. == Synopsis Declared in `<bdlpcre_regex.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int subpatternIndex(char const* name) const; ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#