你有没看过Boost.Regex?
const boost::regex e("l?nole*[0-9]"); if (regex_match("linoleum1", e)) { //we have a match! } else { //no match }