Re: Regex with backslashes in a collection

2022-08-13 Thread arocker
> 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

Regex with backslashes in a collection

2022-08-13 Thread JohnBeckett
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 following pattern also find the two backslashes. \\[\[\]] Help says that a backslash in a collection (if not followed by certain characters) just means a backslash. :he