rPossessive constant Null safety
Selects all possessive apostrophes:
- selects all instances of "'s" or "'S" where U+0027 is followed by an "s", preceded by a letter or digit and followed by a character other than a letter or digit.
- selects all instances of "'" where U+0027 is preceded by "s" or "S" and followed by a character other than a letter or digit.
Implementation
static const rPossessive =
r"(?<=[a-zA-Z0-9])('s|'S)(?=[^a-zA-Z0-9])|(?<=[sS])(')(?=[^a-zA-Z])";