Find unbalanced parenthesis and/or square brackets

Hello,
I usually work with tens of thousands of files, whose filenames have parenthesis and square brackets. Ocassionally I catch unbalanced ones, totally by chance, and correct them.
So my question is how I can use the Find tool of Dopus to filter those rogue files, if it is possible of course.

These are some examples:

"This is (a) filename [that has] no problem (at all).txt" <-- ok
"This one has unbalanced) [parentheshis].txt <-- unbalanced
"This one has (unbalanced) square bracket].txt <-- unbalanced
"This one has) unbalanced) [parentheshis].txt <-- unbalanced
"This one has )unbalanced( [parentheshis].txt <-- this one is more tricky, it has no unbalance but inverted parenthesis

Thanks for reading

You could have a script column which reports Yes/No for unbalanced parentheses, and then use Find on that.

The script code could apply any logic you want to decide if the filenames are OK or not.

Leo, could you please elaborate a bit more on this, as I understand the solution requieres scipting (what language?, where to insert it?) as I'll hire someone at work to do the job.
thanks

JScript or VBScript.

There's a simple example script which adds Yes/No values to a column here: Find folders that do not have a specific file?

There's also one in the manual which does a few more things:
https://www.gpsoft.com.au/help/opus12/index.html#!Documents/Scripting/Adding_a_new_Column.htm

Other general scripting topics from the manual:

https://www.gpsoft.com.au/help/opus12/index.html#!Documents/Scripting.htm

https://www.gpsoft.com.au/help/opus12/index.html#!Documents/Scripting/scriptingobjects.htm