Saturday, August 13, 2022

Re: Regex with backslashes in a collection

> I'm using Vim 8 or 9 with 'magic' and re=0 (same using re=1).
>
> I want to find "\[" or "\]" in text like:
> abc\[def\]ghi\\xy\z
>

The problem may lie in the boundary of a character class, [ and ] and the
rules about its content.
Does the regex interpreter read [\[] as 2 characters, "\ or ]" or as one
"literal ]"; or "literal \"? How is the following "]" parsed?

There may be enough ambiguity in the definitions that tests will only be
valid in the particular interpreter.

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/2135b4df97d80b0a2cb550f234346447.squirrel%40webmail.vybenetworks.com.

No comments: