I'm working on some custom rules for SpamAssassin and I've come across a question I really don't quite understand and have not yet been able to find the answer to.
print "Match on line $. with \n" if (/[htm|asp]/);
print "Match on line $. with ()\n" if (/(htm|asp)/);
Match on line 1 with 
Match on line 1 with ()
Match on line 2 with 
Match on line 2 with ()
Match on line 3 with 
What I'm not clear on is the difference between the actions of the [ ] and ( ). From the actions of my test script, I believe the (htm|asp) is an 'or' condition (htm or asp). I'm not clear on why the [htm|asp] is matching on the third line of data.
Links to more info appreciated.
Update: Thanks davido and Enlil. Perfect explanations. Thanks for the links for more info too.