D语言新手问题 Dlang如何使用正则

· Created · Last modified by Ding replied at · 93 times read
import std.regex;
void main()
{
    auto res1 = match("emoji?棒", regex(`^([\u4E00-\u9FA5A-Za-z0-9])[\u0000-\uFFFF][^""\\\,;]+$`));
    // 匹配到字符串,返回不为空
    assert(res1.empty() == false);
}
Login to reply