on an announce in a channel ($3) this part of hte announce always ends in -RANDOMTHING i want to read from names.txt and see if -RANDOMTHING is already in there, if so { halt } if not it should add it to names.txt,

$3 could be any size and have -WORD-WORD_word-WORD
but i only want to catch the end

if anyone has an efficient way to accomplish this it would be greatly appreciated