I found, a while back, a regex library for C++ that was mostly Perl compatible. As you point out, the code actually in Perl is rather difficult to fathem and simply grabbing that part and incorporating it into a C program is not possible. But having that kind of power in the "other" language is so lustful...