Regex - Can you return the matched pattern using sub?

Furthermore, is there an alternative to match_pattern that returns all matches for a pattern?

It would probably help if I could more better documentation about regex functions in Zeek… I have this: https://docs.zeek.org/en/stable/scripts/base/utils/patterns.bro.html but if anybody could recommend more resources it would be appreciated.

Thanks,

Jonah