I was directed to this thread because of another, similar issue i had in another thread. I implemented a function to determine whether a given text matches a highlight.
To avoid duplication, here is a link to the according post: https://forums.mirc.com/ubbthreads.php?ubb=showflat&Number=196007&page=0#Post196007