While it *will* give the proper output, it's rather ugly, and would give a poor example for other initiates. I'd suggest a little tune-up:
...roboticus
When your only tool is a hammer, all problems look like your thumb.
Update: AnomalousMonk pointed out my blindness: he *is* using the capture group. D'oh!
In reply to Re^2: problem with substitute in regexp
by roboticus
in thread problem with substitute in regexp
by upaksh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |