Filter Global Search (inspired by RegEx Non-capturing match)

Another person has asked abut this, and @I-d-as posted a workaround that I should have thought of:

EDIT: The workaround doesn’t fully work, but I posted a version that does:

As mentioned in that post I also found a way to do what you want in principle, but it freezes Obsidian. :face_with_diagonal_mouth:

It might be possible to search the context term, copy the results, and run some kind of macro to search the main term using each of the results in a path: selector.

Obviously a built-in syntax would be better, or a way to chain searches (like a pipe in shell scripting).