On Sat 1-Dec-07 5:23am -0600, Nico Weber wrote:
> `:echo match("ip", "i\|p")` results in "-1" (ie. no match). I'd expect
> that I get "0" as the pattern matches right at the start of the string
> ("i" is "i" or "p"). The documentation for `match()` claims that
> ordinary regex patterns with 'magic' set are accepted. Everything
> except branches seems to work (I tried character classes and
> wildcards), but the above does not. Is this a bug, or am I missing
> something?
If you choose to place the regex in a string, you'll need to
escape that '\' character. Use either:
:echo match("ip", "i\\|p")
or
:echo match("ip", 'i\|p')
--
Best regards,
Bill
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---