Regular Expression String Length Function In C