JR:
Is this working as expected? Or am I doing it wrong?
I am not sure how a IRC bot could consume more than a tiny fraction of the CPU time of a modern multi-GHz processor.
And I am not sure if regular expressions are a good idea to implement a IRC interface.
But the author of the current regex module is probably interested in your profiling of his module.
Bye, bearophile