Re: pattern syntax for match()
scowles <[email protected]> Wed, 25 Mar 2026 13:16:26 -0700
| Newsgroups | gmane.editors.vim |
|---|---|
| Message-ID | <[email protected]> |
------JOD9PFAEZSQJXVJ8URHTX7F1MRV622 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable tim / christian thank you. both forms work as expected: single and double quoted forms. = in all of my quoting permutations, i had been escaping the bar, also. works fine, now. many thanks. On March 25, 2026 12:41:15 PM PDT, Christian Brabandt <[email protected]> = wrote: > >On Mi, 25 M=C3=A4r 2026, Tim Chase wrote: > >> On 2026-03-25 12:01, S. Cowles wrote: >> > i would like to do the following operation: >> > let m =3D match( "foo" , "foo\|beep" ) >> > however, i get no match. (m is (-1).) >> > what is the correct pattern syntax to enable this match? >>=20 >> Because they're strings, do you need to escape the "\", making it >>=20 >> let m =3D match( "foo" , "foo\\|beep" ) > >Or a bit more readable, use single quotes instead. > >Thanks, >Christian >--=20 >Are we not men? > >--=20 >--=20 >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 > >---=20 >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 [email protected]. >To view this discussion visit https://groups.google.com/d/msgid/vim_use/ac= Q6W0dcgdWjG1p2%40256bit.org. > --=20 [email protected] +1 510 380 8661 --=20 --=20 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 ---=20 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 e= mail to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/vim_use/4FE= 63A02-A028-4A71-A507-FB883EEDBB1B%40sonic.net. ------JOD9PFAEZSQJXVJ8URHTX7F1MRV622 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <html><head></head><body><div dir=3D"auto"><br>tim / christian<br><br>thank= you.=C2=A0 both forms work as expected:=C2=A0 single and double quoted for= ms.=C2=A0 in all of my quoting permutations, i had been escaping the bar, a= lso.<br><br>works fine, now.=C2=A0 many thanks.<br></div><br><br><div class= =3D"gmail_quote"><div dir=3D"auto">On March 25, 2026 12:41:15 PM PDT, Chris= tian Brabandt <[email protected]> wrote:</div><blockquote class=3D"g= mail_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(= 204, 204, 204); padding-left: 1ex;"> <pre class=3D"com-fsck-k9__plain-text-message-pre"><div dir=3D"auto"><br>On= Mi, 25 M=C3=A4r 2026, Tim Chase wrote:<br><br></div><blockquote class=3D"g= mail_quote" style=3D"margin-bottom: 1ex; --com-fsck-k9__blockquote-default-= border-color: #729fcf;"><div dir=3D"auto">On 2026-03-25 12:01, S. Cowles wr= ote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin-bottom: 1ex= ; --com-fsck-k9__blockquote-default-border-color: #ad7fa8;"><div dir=3D"aut= o">i would like to do the following operation:<br> let m =3D match( "foo" ,= "foo\|beep" )<br>however, i get no match. (m is (-1).)<br>what is the cor= rect pattern syntax to enable this match?<br></div></blockquote><div dir=3D= "auto"><br>Because they're strings, do you need to escape the "\", making i= t<br><br> let m =3D match( "foo" , "foo\\|beep" )<br></div></blockquote><d= iv dir=3D"auto"><br>Or a bit more readable, use single quotes instead.<br><= br>Thanks,<br>Christian<br></div></pre></blockquote></div><div dir=3D"auto"= ><div class=3D'k9mail-signature'>-- <br>[email protected]<br>+1 510 380 866= 1</div></div></body></html> <p></p> -- <br /> -- <br /> You received this message from the "vim_use" maillist.<br /> Do not top-post! Type your reply below the text you are replying to.<br /> For more information, visit <a href=3D"http://www.vim.org/maillist.php">htt= p://www.vim.org/maillist.php</a><br /> <br /> --- <br /> You received this message because you are subscribed to the Google Groups &= quot;vim_use" group.<br /> To unsubscribe from this group and stop receiving emails from it, send an e= mail to <a href=3D"mailto:[email protected]">vim_use+uns= [email protected]</a>.<br /> To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/= vim_use/4FE63A02-A028-4A71-A507-FB883EEDBB1B%40sonic.net?utm_medium=3Demail= &utm_source=3Dfooter">https://groups.google.com/d/msgid/vim_use/4FE63A02-A0= 28-4A71-A507-FB883EEDBB1B%40sonic.net</a>.<br /> ------JOD9PFAEZSQJXVJ8URHTX7F1MRV622--