you can you GNU Regular expressions Library

http://www.gnu.org/s/hello/manual/li...pressions.html