How to use regex groups in Airtable formula functions

I’m trying to pull out a filename from a text field using regex patterns. The pattern works fine when I test it online but breaks when I use it in Airtable.

Here’s my sample data: Project Files - Archive 📁 - documents [123456789012345678].zip_Contents\photo_2023.PNG

I want to extract everything after the backslash. My regex pattern is (?:[\\])(.*) which uses a non-capturing group for the backslash followed by a capturing group for the filename.

When I write REGEX_EXTRACT({FileData}, '(?:[\\])(.*)') it throws an error. But simple patterns like REGEX_EXTRACT({FileData}, '[A-Za-z]+\.[A-Za-z]+') work and return ‘Project Files’.

If I try REGEX_EXTRACT({FileData}, '(?>[A-Za-z]+)(\.[A-Za-z]+)') I get #ERROR again.

Does Airtable have limited regex support? What’s the right way to use capturing groups in their formulas?

yeah, airtable’s regex can be a bit tricky. maybe try REGEX_EXTRACT({FileData}, '\\(.*)$') since double backslashes are important. simpler stuff usually does the job better.

Yeah, Airtable’s regex is weird. Their REGEX_EXTRACT function doesn’t work like normal regex - it’s missing features and handles things differently.

Try this instead:
REGEX_EXTRACT({FileData}, '\\(.*)$')

What I’ve learned from fighting with Airtable formulas:

  • Need four backslashes for one literal backslash
  • Non-capturing groups (?:...) break things
  • No lookahead/lookbehind support

I had the same headache parsing file paths in a project base. Gave up on regex and used RIGHT() and FIND() instead - way more reliable.

If regex keeps breaking, this always works:
RIGHT({FileData}, LEN({FileData}) - FIND("\\", {FileData}))

Not pretty but bulletproof.