FUNCTION::MATCHED_STR(3stap)

✨ FUNCTION::MATCHED_STR ✨

okay bestie, welcome to the 3stap manual β€” yes that's the SystemTap Tapset Reference, and yes we're about to get extremely specific about one tiny little function that's carrying the whole regexp game on its back πŸ’…


🌸 NAME 🌸

function::matched_str β€” Return the last matched string.

like... literally. that's the whole job. and it does it flawlessly πŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

matched_str:string()

that's it. that's the whole vibe. no arguments, no drama, just a string coming back at you ✨


πŸ“ ARGUMENTS πŸ“

None

fr fr, nothing. she takes no arguments. she simply knows πŸ™ˆ


πŸ’– DESCRIPTION πŸ’–

okay so here's the tea β˜•

matched_str returns the string matched by the last successful use of the =~ regexp matching operator. that's the whole thing. you do a =~, it works, and then this function hands you back exactly what got matched. iconic behavior, no notes πŸ‘‘

but β€” and this is the important part, bestie, listen β€” if the last use of =~ led to a failed match, this function returns an error. like, it's not gonna be cute about it. no empty string, no polite little shrug. it's an error. so make sure your last =~ actually succeeded before you come asking for the goods πŸ’€

lowkey a vibe check situation: only call matched_str when you know the match worked. iykyk 🀞

πŸ‘‘ SEE ALSO πŸ‘‘

go read that one too, she's the main character of this whole regexp storyline 🌈


SystemTap Tapset Reference Β· September 2026

mwah πŸ’‹ that's the whole page. stay regexp-ing, bestie β€” and may all your matches be successful ones πŸ§šβ€β™€οΈβœ¨πŸ«Ά

πŸ“¦ where this page comes from