Remove dependency on <regex> since it isn't available before gcc 4.9.