simplest is assuming it's not a word that won't have false matches, like the way "word" is inside "sword" is within other words:

Code:
on ^*:TEXT:*example*:#*:{
  echo -s halted line in $chan from $nick $+ : $1-
  haltdef
}

it's the same things i showed above. The code gets pasted into a script within the remotes window (press Alt-R key)