I do Google sheets and I'm fighting with REGEXREPLACE
function past few hours, in general I have this:
string1: "blah blah blah @abc blah @bcd blah blah"
And I want this:
string2: "@abc @bcd"
I try to extract it with REGEXEXTRACT(string1,"@[^\s]+")
but this function won't work global, so I use REGEXREPLACE
to replace everything else than @abc
and @bcd
to ""
, but to do that I need to negate @[^\s]+
!
How to do that?
(@\S+\s*)|[^@]+
and replace with$1