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?
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.
This topic was solved and automatically closed 15 days after the last reply. New replies are no longer allowed.