Wednesday, March 25, 2026

Re: pattern syntax for match()

On 2026-03-25 12:01, S. Cowles wrote:
> i would like to do the following operation:
> let m = match( "foo" , "foo\|beep" )
> however, i get no match. (m is (-1).)
> what is the correct pattern syntax to enable this match?

Because they're strings, do you need to escape the "\", making it

let m = match( "foo" , "foo\\|beep" )

-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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/acQ5bWo0u3TymbWb%40thechases.com.

No comments: