std::regex_...slate_nocase(3)

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

πŸŽ€ std::regex_...slate_nocase(3) πŸŽ€

okay so bestie, welcome to the C++ Standard Libary manual page titled std::regex_...slate_nocase(3) β€” yes, the title is giving truncated-era drama, but the actual function we're talking about is std::regex_traits::translate_nocase, and it is here to serve case-insensitive comparison-key realness. πŸ’…βœ¨

πŸͺ© NAME

  • std::regex_traits::translate_nocase - std::regex_traits::translate_nocase β€” yep, the name is also the name again. it's giving echo but make it iconic. 🫢

✨ Synopsis ✨

CharT translate_nocase( CharT c ) const;

okay so what does it do? It obtains the comparison key for the character c, such that all characters that are equivalent to this character in the imbued locale, ignoring the case differences, if any, produce the same key. literally key-match energy. πŸ”‘

When the regex library needs to match two characters c1 and c2 and the flag std::regex_constants::icase is true, it executes:

regex_traits<>::translate_nocase(c1) ==
regex_traits<>::translate_nocase(c2)

Standard library specializations of std::regex_traits return:

std::use_facet<std::ctype<CharT>>(getloc()).tolower(c)

that is, convert c to lowercase, using the currently imbued locale. no cap, that's the whole glow-up. 🌸

πŸ’– Parameters πŸ’–

  • c β€” character that needs to be examined for equivalence, ignoring case. bestie is under case-insensitive investigation πŸ”

🌈 Return value 🌈

The case-insensitive comparison key for c in the currently imbued locale. that's the vibe check result, periodt. πŸ’…

πŸ¦‹ Example πŸ¦‹

This section is incomplete Reason: no example

bestie, we are collectively crying in the group chat 😭 no example yet.

πŸ—‚οΈ Category

  • Todo no example

kisses from http://cppreference.com, version/date 2024.06.10, original page std::regex_...slate_nocase(3) β€” bye bestie, slay your regexes safely πŸ«ΆπŸ’–βœ¨

πŸ“¦ where this page comes from