如何从 Linux 中的 whois 命令中剪切字符串

How to cut string from whois command in Linux

如何在 CentOS Linux 上使用 PHP 从 whois 命令中剪切字符串?

我只想从 Domain Name: 行剪切到 >>>Last update...<<< 行。

我的代码:

<?php
$output = shell_exec('whois facebook.com');
$result = preg_split('/\n\n/', trim($output));
var_dump($result);
?>

如何使用sed:

whois facebook.com | sed -n '/^Domain names/,/^>>> Last update/p'

这将获取以 Domain names 开头的行和以 >>> Last update

开头的行之间的所有行