delimeter matcher using array stack