PCRE2_SET_BSR(3)

πŸ’– PCRE2_SET_BSR πŸ’–

okay so welcome to the PCRE2 girlies β€” that's Perl-compatible regular expressions (revised API), in case you were wondering, and yes this whole little family of pages lives under the Library Functions Manual umbrella. bestie, we're about to set a convention, and honestly? it's giving main character energy. πŸŽ€


✨ SYNOPSIS ✨

like, here's the exact spelling, no cap:

#include <pcre2.h>

int pcre2_set_bsr(pcre2_compile_context *ccontext,
  uint32_t value);

two arguments, one int back, classic. πŸ’…


🌸 DESCRIPTION 🌸

okay so this function sets the convention for processing \R within a compile context β€” literally what it says on the tin, no extra lore. ✨

the second argument (value, the uint32_t one, iykyk) must be one of these two icons:

  • PCRE2_BSR_ANYCRLF
  • PCRE2_BSR_UNICODE

that's the whole vibe check β€” those are the only two allowed, fr fr. πŸ™ˆ

and the result?

  • zero β†’ slay, success πŸ’–
  • PCRE2_ERROR_BADDATA β†’ if that second argument is invalid, like it just didn't pass, bestie 😭
⚠️ heads up: invalid value doesn't get fixed up for you β€” it's a PCRE2_ERROR_BADDATA return, periodt.

if you want the whole complete description of the PCRE2 native API, that lives over on the pcre2api page πŸ¦‹, and if POSIX is more your thing, the POSIX API is described on the pcre2posix page 🌈.


🫢 the cute sign-off 🫢

this gorgeous lil page is from PCRE2 10.47, dated 25 October 2014 β€” yes she's been iconic since 2014 and she's still serving. mwah πŸ’œπŸ§šβ€β™€οΈβ­

πŸ“¦ where this page comes from