std::match_results::length(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’– std::match_results::length(3) πŸ’–

okay bestie, welcome to the C++ Standard Libary manual page, section 3 β€” manual name folded in right here so we don’t have to copy the header line, you’re welcome πŸ’…. We’re talking about std::match_results::length, and it’s literally giving β€œhow long is this match, actually?” energy. ✨

🌸 NAME 🌸

  • std::match_results::length β€” std::match_results::length

🌟 Synopsis 🌟

difference_type length( size_type n = 0 ) const;  (since C++11)

Returns the length of the specified sub-match. 🫢

  • If n == 0, the length of the entire matched expression is returned. πŸ’―
  • If n > 0 && n < size(), the length of the n^th sub-match is returned. πŸŽ€
  • If n >= size(), a length of the unmatched match is returned. 😭

The call is equivalent to (*this)[n].length(). No cap, that’s the whole vibe. 🌈

πŸ¦‹ Parameters πŸ¦‹

  • n β€” integral number specifying which match to examine.

πŸ‘‘ Return value πŸ‘‘

The length of the specified match or sub-match. That’s it, that’s the tea. πŸ“

✨ See also ✨

  • operator[] β€” returns specified sub-match (public member function).
  • length β€” returns the length of the match (if any) (public member function of std::sub_match<BidirIt>).

byeee bestie πŸ’œ β€” this iconic little page came from source http://cppreference.com, dated 2024.06.10, and it’s the std::match_results::length(3) page. periodt. πŸŽ€

πŸ“¦ where this page comes from