コード例 #1
0
ファイル: expression_node.cpp プロジェクト: gischen/mapnik
value regex_match_node::apply(value const& v) const
{
    auto const& pattern = impl_.get()->pattern_;
#if defined(BOOST_REGEX_HAS_ICU)
    return boost::u32regex_match(v.to_unicode(),pattern);
#else
    return boost::regex_match(v.to_string(),pattern);
#endif
}
コード例 #2
0
ファイル: expression_node.cpp プロジェクト: gischen/mapnik
value regex_replace_node::apply(value const& v) const
{
    auto const& pattern = impl_.get()->pattern_;
    auto const& format = impl_.get()->format_;
#if defined(BOOST_REGEX_HAS_ICU)
    return boost::u32regex_replace(v.to_unicode(),pattern,format);
#else
    std::string repl = boost::regex_replace(v.to_string(),pattern,format);
    transcoder tr_("utf8");
    return tr_.transcode(repl.c_str());
#endif
}