Pull contents of specific kirbytext tag from content file

I want the ability to pull in some videos from multiple pages into a gallery block that I’m building that would be inserted on a different page.

The problem is, most of these pages don’t have the video in a separate field, but have it in a vimeo kirbytext tag in the main content of the text field.

So is there a way for me to get the text field from a page, and then scrub it and pull out just the vimeo tag?

Sure, that should be possible with some regex voodoo.

What would I be looking for? Ideally I could build off whatever Kirby uses to find kirbytext tags and use that instead of rolling my own.

Well, yes, have a look at the parse method in /kirby/core/kirbytext.php. Or the columns plugin could also be a starting point. It uses a kirbytext filter, but the idea is the same.

Thanks. Turns out requirements are different than what I was originally told, so I’m not sure I’ll get around to working on this again.