Skip to main content
Question

Formula for Deleting Lines of Text

  • December 29, 2025
  • 2 replies
  • 26 views

Forum|alt.badge.img+2

A couple months back, I asked for help deleting lines of text beginning with the word ‘Highlight’ and was given this great formula:

 

REGEX_REPLACE(

{Hook},

".*Highlight.*\\n\n?",

""

)

 

It has been a huge time-saver but something I forgot to ask with my original question is if there is a way to add a blank line/line break where those lines were. I input data into the records that looks like:

Highlight(blue) - Page 34 · Location 290

“Look at that. That thing’s almost a book.”

Highlight(yellow) - Page 34 · Location 292

“You think… she’s going to print it? When it’s done?”

Highlight(pink) - Page 34 · Location 294

“I hope so,” I say as brightly as I can manage. 

 

And when using the current formula, it comes out like:

“Look at that. That thing’s almost a book.”

“You think… she’s going to print it? When it’s done?”

“I hope so,” I say as brightly as I can manage.

 

But I need blank lines where the lines starting with ‘Highlight’ were so it looks like:

“Look at that. That thing’s almost a book.”

 

“You think… she’s going to print it? When it’s done?”

 

“I hope so,” I say as brightly as I can manage.

 

I’ve tried using the AI assist and formula generators to add blank lines or adjust the formula to add a blank line but it always gives me an error so I’m hoping someone may know how to adjust the formula to accomplish this. 

2 replies

ScottWorld
Forum|alt.badge.img+35
  • Genius
  • December 29, 2025

You would just need to change your formula to this:

REGEX_REPLACE(
{Hook},
".*Highlight.*\\n\n?",
"\n"
)

- ScottWorld, Expert Airtable Consultant


Forum|alt.badge.img+2
  • Author
  • New Participant
  • December 29, 2025

You would just need to change your formula to this:

REGEX_REPLACE(
{Hook},
".*Highlight.*\\n\n?",
"\n"
)

- ScottWorld, Expert Airtable Consultant

That worked perfectly, thank you so much!