in reply to Order of terms in square braces

In the first case, this part of your character class \)-< is a character range. Ie. It is equivalent to all the characters between ')' (ascii 41) and '<' (ascii 60), which includes ascii 44, ','.

In the second case, by placing the '-' as the first character inside the brackets, you've disabled the range function and it is treated as a normal character,


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."