Help

Regex Formula for This Pattern

Topic Labels: Formulas
Solved
Jump to Solution
704 2
cancel
Showing results for 
Search instead for 
Did you mean: 

Hi Guys,

I am trying to wrap my head around regex formula but can't figure out what if there are two patterns in the string. Basically I want to extract the number after the bracket but before the "+".

Current value : /Date(1676537746330+0000)/

Desired value : 1676537746330

 

Thanks

1 Solution

Accepted Solutions
Ron_Daniel
8 - Airtable Astronomer
8 - Airtable Astronomer

Hi @Hendrik_Yang ,
You didn't mention whether the last four digits are always 0000, but here it is both ways:
Screen Shot 2023-02-21 at 4.01.03 PM.png

If always 0000, then the formula is:

VALUE(REGEX_EXTRACT({Orig value}, "Date\\((\\d+)\\+0000\\)", 1))

If those last four change, then use:
VALUE(REGEX_EXTRACT({Orig value}, "Date\\((\\d+)\\+\\d{4}\\)", 1))

Hope that helps!
- Ron

See Solution in Thread

2 Replies 2
Ron_Daniel
8 - Airtable Astronomer
8 - Airtable Astronomer

Hi @Hendrik_Yang ,
You didn't mention whether the last four digits are always 0000, but here it is both ways:
Screen Shot 2023-02-21 at 4.01.03 PM.png

If always 0000, then the formula is:

VALUE(REGEX_EXTRACT({Orig value}, "Date\\((\\d+)\\+0000\\)", 1))

If those last four change, then use:
VALUE(REGEX_EXTRACT({Orig value}, "Date\\((\\d+)\\+\\d{4}\\)", 1))

Hope that helps!
- Ron

Hi @Ron_Daniel ,

Brilliant! Thanks a bunch!