Support for Mid-String Wildcards in Edge Function `path` Config

Hi,

In Netlify Edge Functions, the inline config allows the path key to accept a string with a wildcard (*). However, the wildcard can only be used at the end of a path segment, not in the middle of a string. For example, /jobs/* is valid, but /jobs/*.html is not.

My site has nested URLs structured like this:

  • mysite.com/diocese/hampshire/parishes/st-michaels
  • mysite.com/diocese/niort/parishes/jean-de-baptist
  • mysite.com/diocese/greendale/parishes/thomas-more

I need to configure an Edge function with a path value of mysite.com/diocese/*/parishes/*, but due to the restriction on wildcards in the middle of strings, this isn’t possible. The only alternative would be to use an array of strings for each possible diocese-parish combination, but with thousands of potential combinations, this approach is impractical and time-consuming.

Would it be possible to support wildcards in the middle of strings for the path key in Edge function config? At present, I can’t think of a feasible workaround.

Thank you for your consideration.

Best regards,
Chris

You can use RegEx:

export const config = {
  pattern: '/^\\/diocese\\/.*\\/parishes\\/.*$/'
}