I’m stuck trying to get a filename from another cell in Airtable. My regex works fine on regex101.com but Airtable keeps giving me errors. Here’s what I’m dealing with:
My regex: (?:[\])(.*)
Example string: Tech Stuff - Old Channels 💀 - image-assets [839605635295772672].csv_Files\IMG_0165-E23DF.JPG
As someone who’s grappled with Airtable’s regex limitations, I can offer a workaround that’s proven reliable. Instead of complex regex patterns, consider using a combination of Airtable’s built-in functions:
REGEX_EXTRACT({Attachments}, ‘([^\]+)$’)
This extracts everything after the last backslash. If you need to remove the extension:
It’s not elegant, but it’s consistent within Airtable’s constraints. Remember, Airtable’s regex support is basic, so simpler patterns often work better. Test thoroughly, as results can vary based on your specific data structure.
Having worked extensively with Airtable and regex, I can share some insights. Airtable’s regex support is indeed limited compared to full-fledged regex engines. For your specific case, I’ve found success using a simpler approach:
REGEX_EXTRACT({Attachments}, ‘[^\/]+.[^\/]+$’)
This pattern looks for the last segment after a backslash or forward slash that includes a dot, effectively capturing the filename with extension. It’s more robust and works well within Airtable’s constraints.
If you need just the filename without extension, you can further process it:
Remember, Airtable’s regex implementation can be finicky. When in doubt, break complex patterns into smaller steps using multiple formulas. It’s less elegant but often more reliable in Airtable’s environment.