0

I'm trying to search for quotation mark, but it seems it doesn't work:

\v^\s"\zs\"+

is what i tried. Though I'm well aware it need to be escaped...I tried:

\v^\s""\zs\""+

given what was said here, though I'm guessing this method only work for single quotes.

And lastly tried this:

\v^\s\"\zs\\"+

where i try to escape it with a \. (afaik).

Any way to escape double quotes here?

Nordine Lotfi
  • 683
  • 4
  • 16
  • 1
    Do you mean to search for \v^\s*\zs"+ ? That will match one or more " after optional whitespace at the beginning of a line... – filbranden Sep 17 '20 at 05:34

1 Answers1

1

Looks like you adapted this from the regex in the previous question matching *s.

But * is a metacharacter to match 0 or more of the previous token. That means:

  1. You should still use * (not ") after \s to match optional whitespace at the beginning of the line.
  2. You shouldn't use a backslash to escape the ", since " is not a metacharacter. It was needed for * to match a literal *, but it's not needed for ". (It still works if you escape it, but you don't need it.)

This regex should work: \v^\s*\zs"+

filbranden
  • 28,785
  • 3
  • 26
  • 71