Fixed the regex function, and got it compiling again with the WITH_REGEX flag.
Upon return of the REGEX() function, _M$["length"] will now contain the number of matches.
I ran it thorugh Valgrind, and identified some memory leaks. Haven't had a chance to fix them yet.