如何展开RFC 822 [英] How to do unfolding RFC 822

查看:79
本文介绍了如何展开RFC 822的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编写vCard解析器,但在展开行时遇到了麻烦. 如您在此处看到的: http://www.faqs.org/rfcs/rfc822.html查找展开",表示以下所有内容均有效:

I am trying to write a vCard Parser and am having trouble unfolding lines. As you can see here: http://www.faqs.org/rfcs/rfc822.html look for "unfolding" it says that all the following are valid:

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:)

How do I unfold this? Is there a regex for this? I am using PHP if a class has been written I will use that :)

推荐答案

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

You could use this to remove those foldings:

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

这篇关于如何展开RFC 822的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆