Added auto-detection of C++ in pyx, regexpr for template rendering