Regex check and BOOST_FOREACH