FUNCTION::MATCHED(3stap)
π FUNCTION::MATCHED(3stap) π
okay bestie, welcome to the FUNCTION::MATCHED(3stap) page, straight out of the A collection of standard strin manual (yes the title's cut off like that, we love a mystery β¨). this is your lil guide to grabbing pieces of a regex match, and ngl it's giving main character energy.
β¨ NAME β¨
function::matched β Return a given matched subexpression. π
πΈ SYNOPSIS πΈ
matched:string(n:long)
π ARGUMENTS π
nβ the index of the subexpression you wanna get back. and like,0is special: it corresponds to the entire regular expression. yes, the whole thing. the moment. the icon. π
π¦ DESCRIPTION π¦
so what this does: it returns the content of the n'th subexpression of the last successful use of the =~ regex matching operator. that's the whole vibe. π«Ά
if that n'th subexpression was not matched (e.g. due to alternation), you get an empty string back. no drama, just an empty lil string. π
but listen β it throws an error if the last use of =~ was a failed match, or if there are fewer than n subexpressions present in the original regexp. so like, mind your indices, fr fr. π
lowkey important: failed =~ + this function = error. not a vibe. check your match first, bestie. π
π₯ SEE ALSO π₯
and that's the whole page, periodt. π§ this was the SystemTap Tapset Reference, Ver, dated September 2026 β thanks for coming to my ted talk, ily, go match some subexpressions responsibly ππ
π¦ where this page comes from
- centos-stream 10: systemtap-client 5.6-3.el10 Β· GPL-2.0-or-later AND GPL-2.0-only AND BSD-3-Clause AND LGPL-2.1-only AND GFDL-1.2-or-later AND BSD-2-Clause
- centos-stream 9: systemtap-client 5.6-3.el9 Β· GPL-2.0-or-later AND GPL-2.0-only AND BSD-3-Clause AND LGPL-2.1-only AND GFDL-1.2-or-later AND BSD-2-Clause
- fedora 43: systemtap-client 5.6-1.fc43 Β· GPL-2.0-or-later AND GPL-2.0-only AND BSD-3-Clause AND LGPL-2.1-only AND GFDL-1.2-or-later AND BSD-2-Clause
- fedora 44: systemtap-client 5.6-1.fc44 Β· GPL-2.0-or-later AND GPL-2.0-only AND BSD-3-Clause AND LGPL-2.1-only AND GFDL-1.2-or-later AND BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms