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?

1
  • 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
    Commented Sep 17, 2020 at 5:34

1 Answer 1

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"+

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.