【问题标题】:How to do unfolding RFC 822如何展开 RFC 822
【发布时间】:2011-05-12 18:48:21
【问题描述】:

我正在尝试编写 vCard 解析器,但无法展开线条。 正如您在此处看到的:http://www.faqs.org/rfcs/rfc822.html 寻找“展开”它表示以下所有内容都是有效的:

Long string<return>
<tab>continue

Long string<return>
<tab>(n*<tab>)continue

Long string<return>
<space>continue

Long string<return>
<space>(n*<space>)continue

我该如何展开?有这个正则表达式吗?如果已经编写了一个类,我将使用 PHP :)

【问题讨论】:

    标签: php rfc822 unfold


    【解决方案1】:

    您可以使用它来移除这些折叠:

    $output = preg_replace('/\r\n(?:[ \t]+)/', '', $input);
    

    【讨论】:

      猜你喜欢
      • 2015-12-12
      • 2020-07-19
      • 2010-12-23
      • 2011-04-22
      • 2013-05-22
      • 1970-01-01
      • 2013-06-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多