in reply to How to Ask a Regex Question (with Test::More) (repost, with Sitedocclan approval)

My problem with this template is that what regex is needed is usually defined as much by what strings it should not match as by what it should. Also, when it does match, how. So it would be very nice if the test harness let you say "the string '' should match with $1 eq 'timmytimmers' and $2 eq '' but the string '!garygerbil' shouldn't match at all". Otherwise, the correct answer is always /.*/.