Code:
while( string[x] )
{
    if( string[x] == opening character )
        push( string[x] )
    else
    if( string[x] == close character )
        if( a_match_pair( pop( ), string[x] ) == FALSE )
            return INVALID
    }
    else
        ignore character
    x++
}
return VALID
You turn it into actual code.

Quzah.