Improve regex matching & use C language dependency