Reputation: 64924
I'm trying to do a global find and replace for old-style PHP tags that look like this:
<%= $username %>
However when I try to do a search and replace in Vim, I get an "E71: Invalid character after \%" warning, and a "E476: Invalid command" warning:
:%s/\<\%/other val/c
I've also tried:
:%s/\<\\%/other val/c " two escapes, returns no matches
Upvotes: 10
Views: 8547
Reputation: 56129
Nothing in this search needs escaping, :%s/<%/<?php/g
works precisely as expected, replacing <%
with <?php
everywhere.
Upvotes: 15