На кликере, с обычным поиском.
[spoiler]#name "Checking groups brackets"
SUB(check_brackets, $st)
$st = STRFILTER($st, "()[]{}", 1)
LOGWRITE("$st = ", $st)
$lmax = STRLEN($st)
$rep = 1
WHILE($rep = 1)
IF(STRLEN($st) = 0)
LOGWRITE("Всё правильно!")
$rep = 0
ELSE
FOR($i=0, $i < 3)
$pos = STRPOS($st, $brackets[$i])
IF($pos > 0)
$st1 = STRCUT2($st, 1, $pos-1)
$st2 = STRCUT2($st, $pos+2, $lmax)
$st = STRCONCAT($st1, $st2)
$i = 10
END_IF
END_CYC
IF($i < 10)
LOGWRITE("Проблемы!")
$rep = 0
END_IF
END_IF
END_CYC
LOGWRITE("**********************")
END_SUB
//==============================================================================
STRSEPARATE("():[]:{}", ":", $brackets)
check_brackets("[[]()]")
check_brackets("()")
check_brackets("({")
check_brackets("({})")
check_brackets("[[]()]")
check_brackets("[{()}]")
check_brackets("{(})")
check_brackets("([]")
check_brackets("[])")
check_brackets("еха[ли [медведи] (на ) велоси]педе")
HALT
[/spoiler]