Search a column for text within brackets and then extract text

Hi folks,
I’ve got a table called “Shot List” and I’m trying to have a column within it called "description] look through the text block that will be written in another column in the same table called “dialogue” .

Within the text that is in the “Dialogue” column will be multiple instances of text within brackets ie. [Picks up object] or [ties shoe]

The end result of what I’m after should (ideally) be a bullet list that extracts and shows all of the text that was found inside the brackets in the corresponding row’s “Dialogue” column.

So far I’ve been only able to successfully have just the text within the first set of brackets get pulled to the “description” column. I’m hoping it’s possible with each instance of bracketed text that is in the “Dialogue” column.

Any hints on how to go about this?

My current formula that pulls just the first instance of bracketed text is:

=Concatenate(RegexExtract(thisRow.[Dialogue], “[(.*?)]”))

Thanks for any help!

1 Like

Pretty close!

  • The brackets have to be escaped since they’re regex syntax
  • Gotta add the global flag to get multiple matches
  • Groups doesn’t seem to work, so slice result (Update 2024-04-03: They do work, it’s $1 !)
RegexExtract(thisRow.Dialogue, "\[.+?\]", "g").ForEach(CurrentValue.Slice(2, -2)).BulletedList()

image

1 Like

Ohhhh… my goodness. Thank you. I spent waaaay to long on refusing to give up. :saluting_face:

Coffee Sent!!

1 Like

No worries, glad I could help! Thank you so much for the coffee :yellow_heart:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.