Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
代码就像
<dt> Some text</dt> <dd>some value</dd>
我希望能够仅删除未以 html 标记结尾的新行。我怎样才能做到这一点?
这可以像这样在命令行 Perl 中完成
perl -pe 's/(?<!>)\n//' my.html
或这个
perl -pe 's/([^>])\n/$1/' my.html