Golf A Parentheses Matching Algorithm You will be given a string s. It is guaranteed that the string has equal and at least one [s and ]s. It is also guaranteed that the brackets are balanced. The string can also have other characters.
The objective is to output/return a list of tuples or a list of lists containing indices of each [ and ] pair.
note: The string is zero-indexed.
Example:
!^45sdfd[hello world[[djfut]%%357]sr[jf]s][srtdg][] should return
[(8, 41), (20, 33), (21, 27), (36, 39), (42, 48), (49, 50)] or something equivalent to this. Tuples are not necessary. Lists can also be used.
Test cases:
input:[[asdf][][td([)ty54g% ]hg[[f]u][f[[jhg][gfd]sdf]sdfs]ghd]fr43f]
output:[(0, 62),(1, 6), (7, 8), (9, 56), (13, 22), (25, 30), (26, 28), (31, 52), (33, 47), (34, 38), (39, 43)]
input:[[][][][]][[][][][[[[(]]]]]))
output:[(0, 9), (1, 2), (3, 4), (5, 6), (7, 8), (10,26),(11, 12), (13, 14), (15, 16), (17, 25), (18, 24), (19, 23), (20, 22)]
input:[][][[]]
output:[(0, 1), (2, 3), (4, 7), (5, 6)]
input:[[[[[asd]as]sd]df]fgf][][]
output:[(0, 21), (1, 17), (2, 14), (3, 11), (4, 8), (22, 23), (24, 25)]
input:[]
output:[(0,1)]
input:[[(])]
output:[(0, 5), (1, 3)]

This is code-golf, so the shortest code in bytes for each programming language wins.
Brain-Flak Classic, 108 bytes

{((((((([][][]){}){}){}()){}){}{}[])()()){{}&lt;&gt;{}(&lt;&gt;)}{}((){[](&lt;{}&gt;)}{}){{}&lt;&gt;[({}&lt;[{}]&gt;)](&lt;&gt;)}{}&lt;&gt;(({}()))&lt;&gt;}


Try it online!

Stores each opening [ in the right stack, and outputs whenever we hit a ].