Need help creating regex for the following scenario

I'm having trouble to write a regex for golang because ? is not a quantifiable token.

The scenario i want to match:

app1.foo.bar.com
app2.foo.bar.com

but not:

foo.bar.com
local.foo.bar.com
local.local.foo.bar.com
app1.local.foo.bar.com
app2.local.foo.bar.com

I've tried the following but regex101.com with golang flavour throws the error ? is not a quantifiable token.

^((?!local\.).)*foo\.bar\.com