Help

Using LEN() but excluding URLS in the tweet

Topic Labels: Formulas
1317 3
cancel
Showing results for 
Search instead for 
Did you mean: 
Marlijn
4 - Data Explorer
4 - Data Explorer

Hello!

Currently I am trying to create a formula field to check the length of a text if it is the right length for a tweet. But I want to exclude links in the text, as Twitter always takes 23 characters for a link. So the hyperlinks in my text don’t need to be counted.

Can I make a formula to count only the text which is not part of the url?

3 Replies 3

Welcome to the Airtable community!

Probably. It depends on how complex your links are. You can use REGEX_REPLACE() to remove the links, then find the LEN() of the resulting string. The trick is finding the right regular expression for the type of links you will be including.

All my links probably have .com, .nl or .ly in them, is it possible to exclude them using this? I am new to REGEX formulas.

When it comes to writing formulas, especially formulas with regular expressions, you should aim for “always” rather than just “probably”. There are other issues, as will the links always be prefixed with “https://”, could there be url parameters, etc.