I'm having a hard time understanding why while seems so slow to you..and such a disaster.. since i use it in my bot with a .txt that has many lines and it was tested in big messages and it scanned them in some milliseconds.
In the short but much time i've been scripting (about a year) i've seen while lagging rarely and that was for 1-3 seconds.
But hey.. if regex does the work ..whatever..