matchIt ?-w win? brace pos ?num?
Return the position of the matching brace. This command supports parentheses (), curly braces {}, square brackets [], and angle braces <>. The brace character passed to this command should be the one whose partner you wish to find (not the one you want to search for). This determines the direction of the search: for instance, if you specify a closing parenthesis ), the command will look backwards for the matching opening parenthesis (.
The second argument specifies the position from where to start the search: this is not the position of the original brace. This argument is the first position when looking forwards (respectively the last position when looking backwards) where a matching brace can be found. To be more specific: In both cases, this is the limit value which should be specified as the pos argument. The returned position can't be less than pos when looking forwards and can't be more than pos when looking backwards. For example, if you have the text abc () so that ) is at position 5, then 'matchIt ) 5' will fail to match, but 'matchIt ) 4' will correctly return 4.
The optional third argument specifies how many characters to search starting from the specified position.