in reply to Re^2: Refactoring challenge.
in thread Refactoring challenge.

I was using regex in the earlier versions if you look back, but I personally find the escaped regexes to be most unreadable. I think that the way it is now captures the essence of the tests very well.

In theory at least, you can use /[[}]/ without any escaping as (most) meta characters have no special meaning inside character classes, but it doesn't work in practice.

I actually thought that was true for all meta characters until hv showed me /([\Q[]{},\E])/, which is better than the alternative, but still far from transparent.

I've never used VB, though it's not totally dissimilar to the DEC Basic Plus I used 25 years ago. I still sometimes type instr when I mean index.

(I think instr is the better name for the function actually)


Examine what is said, not who speaks.
Silence betokens consent.
Love the truth but pardon error.