String...Extent(3pm)
β¨ String::Tagged::Extent β¨
okay so bestie, welcome to String::Tagged::Extent β that's the Perl module (a 3pm page, iykyk) that gives you lil range objects living inside a String::Tagged. π
π NAME π
String::Tagged::Extent β the module that represents a range within a String::Tagged. periodt.
πΈ DESCRIPTION πΈ
So here's the tea: these objects represent a range of characters inside the containing String::Tagged object. The range they represent is fixed at the time of creation β locked in, no takebacks. π
β οΈ But listen: if the containing string gets modified by a call to set_substr, then the effect on the extent object is not defined. Like, we don't know what happens. Chaos. Undefined behaviour. π
So treat these objects as relatively short-lived β use them briefly to query the result of an operation, then discard them soon after. They're giving "situationship, not a long-term commitment" energy. π
π¦ METHODS π¦
string
$extent->string;
Returns the containing String::Tagged object. It's giving "who's your parent" energy. π
start
$extent->start;
Returns the start index of the extent. This is the index of the first character within the extent. β¨
end
$extent->end;
Returns the end index of the extent. This is the index of the first character beyond the end of the extent. Yes bestie, it's the character after the last one β that's just how it is. π
anchor_before
$extent->anchor_before;
True if this extent begins "before" the start of the string. Only certain methods return extents with this flag defined. π
anchor_after
$extent->anchor_after;
True if this extent ends "after" the end of the string. Again, only certain methods return extents with this flag defined. π₯
length
$extent->length;
Returns the number of characters within the extent. Math but make it cute. π’
substr
$extent->substr;
Returns the substring contained by the extent, as a String::Tagged complete with all the relevant tag values. It's the full package, tags and all. π«Ά
plain_substr
$extent->plain_substr;
Returns the substring of the underlying plain string buffer contained by the extent, as a plain Perl string. No tags, no drama, just the raw text. π
π AUTHOR π
Paul Evans <leonerd@leonerd.org.uk> β the icon, the legend, the main character who wrote this. π
okay that's the whole page bestie, you ate it up fr fr π
This one's from perl v5.38.2, dated 2024-07-24, and it lives at String...Extent(3pm) β mwah, go forth and query your extents. π
β¨π¦
π¦ where this page comes from
- debian trixie: libstring-tagged-perl 0.24-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libstring-tagged-perl 0.24-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libstring-tagged-perl 0.24-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms