Skip to main content

Hello,

I thought I figured this out using regex, but it didn’t work.

I’m posting from Instagram to Twitter and I want to remove all hashtags.

My second step in my Zap was using the Formatter action with this regex: (?<!#)\b\w+

It captures everything except all the hashtags (great!) except not so great… because it returns all matches (everything that’s not a hashtag) as line items. 

So in my Twitter step, I could have a list of like 50 options (one word per match) making it impossible to choose all for the caption.

There has to be a better way to do this and I’m sure I’m not the first to ask for this! Any help would be greatly appreciated!

Thanks,

WDES

Hi @WDES2021 

Can you post a screenshot of some example text that you are trying to parse/format?


Of course:

 

And here is the output (notice one match per word):

 

 

And the problem:

 

Notice the Output # matches the position of where that word is, due to the match.

Appreciate the interest! Any help would be greatly appreciated,

WDES


@WDES2021 

If the hashtags are always at the end then just split at the first # and keep the first segment.

Action: Formatter > Text > Split: https://zapier.com/help/doc/how-use-formatter-functions#using-split-text


I tend to overthink things… and was trying to come up with a solution for a situation where I’d have a hashtag somewhere in the middle. Realistically I don’t think that will happen, so I’ll just do it the way you mentioned and avoid myself an unnecessary headache. BTW, @Troy Tessalone  - Thanks for the quick reply!


WDES