Code:
ON $*:TEXT:/damn/i:#:

That'll do the matching in the event trigger.

Code:
if ($regex($1-, /damn/i)) {

will do it for an if statement.

By default, regular rexpressions will happily do partial matches, closer to an 'isincs' than a 'iswm', but close enough.