How to extract numeric values after equals sign using Airtable regex functions

I’m working with Airtable and need to pull out just the number that comes after an equals sign from a URL field. Here’s what I’m dealing with:

field= {Customer Base}
url = https://target-pro.store.net/category?id=2847593102

I want to extract only 2847593102 from this.

Here’s my current formula attempt:

IF(
REGEX_MATCH({Customer Base}, "=\\d+"),
SUBSTITUTE(
REGEX_EXTRACT({Customer Base}, "=\\d+"),
"=",
""
)
)

The issue is that some URLs have extra parameters after the number like https://target-pro.store.net/category?id=2847593102&filter=active&display=grid. I need to grab only the digits that immediately follow the equals sign, ignoring everything else that comes after. What’s the best way to modify this regex pattern?

Been debugging regex patterns for URL parsing forever and here’s what actually works reliably in Airtable:

REGEX_EXTRACT({Customer Base}, "=(\d+)")

Drop the IF statement completely. REGEX_EXTRACT returns blank if there’s no match, so you don’t need the conditional check. The capture group (\d+) pulls out just the digits without the equals sign.

Airtable’s regex engine gets finicky with lookbehind assertions, so stick with simple capture groups. This pattern matches any equals sign followed by digits and stops at the first non-digit character. Works perfectly for your case where you have &filter=active trailing after the ID.

Tested this exact pattern on hundreds of product URLs in our inventory system. Never had issues with extra parameters or edge cases.

You’re on the right track but making this way harder than it needs to be. The problem is your regex =\d+ grabs the equals sign too, so you have to use SUBSTITUTE to strip it out. Just use a lookbehind assertion instead: (?<=id=)\d+. This matches only the digits after “id=” without the equals sign. If Airtable doesn’t support lookbehind (some regex engines don’t), try capturing groups: id=(\d+). REGEX_EXTRACT with this pattern should return just the captured digits. I’ve had better luck with capturing groups across different platforms. The \d+ part only grabs consecutive digits, so it’ll automatically ignore other parameters like &filter=active.

Try this pattern: \d+(?=&|$) after your = match. It grabs digits that end with either & or end of string, so it won’t pick up random stuff. If Airtable’s being weird about \d, just use [0-9]+ instead - some platforms don’t like certain regex shortcuts.

Hit this exact problem last month pulling product IDs from inventory URLs. Your approach works, but there’s a cleaner way. Skip the SUBSTITUTE step and use REGEX_EXTRACT({Customer Base}, "id=(\d+)") with a capture group instead. The parentheses around \d+ grab just the number - REGEX_EXTRACT returns it automatically. Need to handle different parameter names? Use =(\d+) to match any equals sign plus digits. This fixes your trailing parameters issue too since \d+ stops at the first non-digit (like the ampersand). Way simpler than all that conditional logic.

Had this exact problem with tracking URLs last year. Use =([0-9]+) instead of =\d+ - it works way better with Airtable’s regex engine. The double backslash escaping sometimes breaks depending on how Airtable handles the formula. Your SUBSTITUTE approach works, but it’s way more complicated than needed. The capture group pulls out just the numbers without extra string manipulation. One heads up - if your URLs have multiple equals signs with numbers (like id=123&count=456), this grabs the first match. For ID parameters, that’s probably what you want anyway.