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.
我正在尝试对看起来像这样的旧式 PHP 标记进行全局查找和替换:
<%= $username %>
但是,当我尝试在 Vim 中进行搜索和替换时,我收到“E71:\% 后的无效字符”警告和“E476:无效命令”警告:
:%s/\<\%/other val/c
我也试过:
:%s/\<\\%/other val/c " two escapes, returns no matches
此搜索中没有任何内容需要转义,:%s/<%/<?php/g完全按预期工作,替换<%为<?php到处。
:%s/<%/<?php/g
<%
<?php