gcc 4.7 crashes when using regex on mac os. remove use of regex again.