Hi,
Bram Moolenaar wrote:
Tyru Exe wrote:
Hi list.
I tested this code on vim73.
:echo \Plug =~# \Plug= 0
Is this right behavior?
Yes, using \Plug as a regexp will give unpredictable behavior.
It's not a valid pattern.
why? AFAIU \Plug is equivalent to 'Plug
Jürgen Krämer wrote:
why? AFAIU \Plug is equivalent to 'Plug' and this is a valid pattern.
Double quoted strings in Vimscript can contain special keys like \CR
which define special key mappings, see :help expr-quote. You can try it
yourself:
:echo \Plug
80fdS
:echo
Hi,
Peter Odding wrote:
Jürgen Krämer wrote:
why? AFAIU \Plug is equivalent to 'Plug' and this is a valid pattern.
Double quoted strings in Vimscript can contain special keys like \CR
which define special key mappings, see :help expr-quote. You can try it
yourself:
:echo \Plug
Tyru Exe wrote:
Hi list.
I tested this code on vim73.
:echo \Plug =~# \Plug= 0
Is this right behavior?
Yes, using \Plug as a regexp will give unpredictable behavior.
It's not a valid pattern.
--
Back up my hard drive? I can't find the reverse switch!
/// Bram Moolenaar -- b
Hi again tyru,
In case you didn't know / haven't found it yet, you can use the stridx()
function instead: stridx(foo \Plug bar, \Plug) = 0 evaluates to
true.
- Peter Odding
--
You received this message from the vim_dev maillist.
Do not top-post! Type your reply below the text you are
Hi list.
I tested this code on vim73.
:echo \Plug =~# \Plug= 0
Is this right behavior?
My :version is:
VIM - Vi IMproved 7.3 BETA (2010 May 15, compiled Jun 10 2010
18:03:10)
Compiled by t...@tyru-linux
Huge version with GTK2 GUI. Features included (+) or not (-):
+arabic +autocmd