RegExp pattern on UID fields
complete
Emilie Ringwald
updated the status to
complete
Hi Eduardo, thanks for the request! Good news: since Strapi v5.16.0, UID fields support a custom RegExp pattern, just like Text fields.
You can set it in the Content-Type Builder, in the UID field's advanced settings. Strapi then checks the value against your pattern instead of the default one, both in the admin panel and through the API.
For example,
^[a-z0-9-]+$
only allows lowercase slugs.Release note: https://github.com/strapi/strapi/releases/tag/v5.16.0