Khaled {
the url itself could contain an unequal number of brackets.
}

If killing they who do not equalize brackets in their urls is not an option, assuming they are in fact equalized must give the cleanest code. I could call the web developer of that one site with unequalized brackets and get him to rethink his thing for unequalized bracket.