How to screen double quotes in Google Docs re2 expressions?
Asked Answered
L

3

10

I'm trying to screen double quotes in regular expression on Google Sheets and there's no luck. A1 cell text = some "name" My formula

=REGEXEXTRACT(A1;"\"(.*)\"")

But Google Docs thinks that i'm using quotes for open /close argument. Please help.

Library that GoogleDocs using for regular expressions is re2

Lentz answered 24/4, 2019 at 5:13 Comment(0)
L
1

=REGEXEXTRACT(A1; "[""]+(\w*)")

Lentz answered 24/4, 2019 at 5:49 Comment(0)
C
13

You need to escape a doublequote " with another doublequote like this "".

Try using this,

=REGEXEXTRACT(A1,"""(.*)""")

Verified and this works well.

Cantwell answered 24/4, 2019 at 6:1 Comment(0)
L
1

=REGEXEXTRACT(A1; "[""]+(\w*)")

Lentz answered 24/4, 2019 at 5:49 Comment(0)
M
1

I know it's been a while here, but for anyone else looking for this answer - make sure you're using the right type of quote (Straight quotes vs Smart quotes). Just copy/paste the type of quote you're looking for

Masqat answered 27/10, 2020 at 16:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.