> searching for "^[[K^[[?1l^[>" using "/" works.
> but when i use the same string in :%s, it says
> the pattern is not found. how to make it recongnize
> as "/" does. or is there any way to automatically
> convert the string to equivalent regexp that :%s
> understands.
While I'm not sure what's happening, if you've already searched
with "/", you can leave the search blank in the :s command:
:%s//replacement/flags
to search for the last thing searched.
My first question would be to ask what the entire :s command is
that you're using. If there's a "]" in the replacement, it can
be seen as closing a character-class started in the search-part. E.g.
:%s/[ /&]/g
searches for the first space/slash/ampersand on the line and
replaces it with a "g". It doesn't look for all the "[ " and put
a closing "]" after them. This can be prevented by escaping
literal "[" characters (assuming that "^[" was a literal escape):
:%s/^[\[K^[\[?1l^[>/replacement/g
^ ^
Hope that gives you some leads.
-tim
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
No comments:
Post a Comment