Extract multiple dates from string text

Hi I am trying to extract the dates (there could be multiple) from a string

For example,
“Supplement:Accepted AnytimeFull Proposal:December 4, 2020Letter of Intent:December 4, 2020Supplement:February 11, 2021Full Proposal:February 11, 2021”

should return -> “December 4, 2020”, “December 4, 2020”, “February 11, 2021”, “February 11, 2021”

Can’t seem to figure out a function that can return multiple substring results

hey @Nikil_Ragav I think this is going to depend on the syntax / structure you are going to consistently have your input data from. In your example each date is preceeded with : so you could use the split() function to break the string into parts and then tackle each of those perhaps with formulamap(), perhaps terminating the string two characters after finding “, 20”? This should get you going… :slight_smile: good luck!

[Original String]
.split(':')
.FormulaMap(
   CurrentValue.RegexReplace('([^ ]+ \d{1,2}, \d{4})?(.*)','$1')
)
.filter(CurrentValue.IsNotBlank())
.BulletedList()
4 Likes

Would love to understand the code here and what is happening.

Thanks in advance

I am trying to figure out how to remove multiple different text strings from one column at one time and haven’t gotten the formula structure correct. I tried nesting them but it didn’t work right.

That’s just standard REGEX, nothing specific to Coda. Ask ChatGPT.

2 Likes

Thanks. Wow, you just improved my excel skills as well.

Someone in the community flagged my post here (has been restored). I guess someone thought it was sarcasm. But actually, I took @Pablo_DV advice, went to ChatGpt (I didn’t know it was not a Coda item) and learned a ton about Regex and how I can use it on excel too. I wasn’t offended by the suggestion to ask ChatGPT because it was a good one in this case.

2 Likes