Help

Removing urls and other lines of text from a text field

Topic Labels: Formulas
351 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Donna
4 - Data Explorer
4 - Data Explorer

Hi, 

Is there a formula that could handle removing urls from a long text field and keeping the rest of the text?

I have been playing around and am not able to achieve this so far. 

I need to omit any string of text that starts with any of the following 4 but keep the rest of the text in the field:

%/IF% 
%F

<https 
https

Thanks! 

1 Reply 1
ProsperSpark
5 - Automation Enthusiast
5 - Automation Enthusiast

HI Donna,

To remove words or strings in an Airtable field that start with '<https' or 'https', you can use the SUBSTITUTE function in combination with a regular expression. Here's a formula that should accomplish this:

SUBSTITUTE({YourTextField}, "<https.*?\\b|https.*?\\b", "")

Replace {YourTextField} with the name of your text field. This formula will search for any words or strings that start with '<https' or 'https' and remove them from the text in the field.

The regular expression pattern "<https.*?\\b|https.*?\\b" matches any string that starts with '<https' or 'https' and continues until it finds a word boundary (indicated by \b). The SUBSTITUTE function then replaces these matched strings with an empty string, effectively removing them from the field.

If you have more questions about formulas or anything Airtable, feel free to ask, and we'll be happy to help! www.prosperspark.com

Take care!