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?
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.
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.