【问题标题】:Boost::Regex DOTALL flagBoost::Regex DOTALL 标志
【发布时间】:2009-11-11 02:50:45
【问题描述】:

是否有用于 boost::regex 的 DOTALL 匹配标志?文档显示:

static const match_flag_type match_not_dot_newline;
static const match_flag_type match_not_dot_null;

但没有提到常规的 DOTALL。

我正在尝试匹配写为

的 python 正则表达式
re.compile(r'<a(.*?)</a>', re.DOTALL)

【问题讨论】:

    标签: c++ regex boost-regex


    【解决方案1】:

    我认为您正在寻找的是 mod_s syntax_option_type。您也可以使用内联修饰符(?s)

    【讨论】:

    • @whatWhat:这里是如何使用内联 DOT-ALL 修饰符:boost::regex e("(?s)&lt;a(.*?)&lt;/a&gt;");
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-04-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多