PCRE2_SUBSTRING_LENGTH_BYNAME(3)

πŸ’– PCRE2_SUBSTRING_LENGTH_BYNAME(3) πŸ’–

okay bestie, welcome to the PCRE2_SUBSTRING_LENGTH_BYNAME(3) page from the Library Functions Manual. It's all about PCRE2 β€” Perl-compatible regular expressions (revised API) β€” and this function is the one that hands you the length of a matched substring by name. πŸŽ€

✨ NAME ✨

PCRE2 β€” Perl-compatible regular expressions (revised API)

🌸 SYNOPSIS 🌸

#include <pcre2.h>

int pcre2_substring_length_byname(pcre2_match_data *match_data,
  PCRE2_SPTR name, PCRE2_SIZE *length);

πŸ¦‹ DESCRIPTION πŸ¦‹

This function returns the length of a matched substring, identified by name. The arguments are:

  • match_data β€” The match data block for the match
  • name β€” The substring name
  • length β€” Where to return the length, or NULL
bestie, listen: the third argument may be NULL if all you want to know is whether or not a substring is set. πŸ‘€

The yield is zero on success, or a negative error code otherwise. No cap.

There is a complete description of the PCRE2 native API in the pcre2api page and a description of the POSIX API in the pcre2posix page.


cute sign-off: this page is from PCRE2 10.47, dated 26 September 2025. πŸ’…βœ¨

πŸ“¦ where this page comes from