in reply to Dealing with undefined captures in a substitution

grinder,
Well, the adjectives elegant, clean, and simple are highly subjective, but I often test before I destroy. In other words, I put the match portion in a conditional and then do the subsitution.

This allows me to figure out what needs to be done in multiple steps (maintainability) rather than try and shove it all in a single expression that is hard to extend or possibly decipher by someone else.

Cheers - L~R

  • Comment on Re: Dealing with undefined captures in a substitution