On Tue, 25 Nov 2025 07:54:52 +0100
Thomas Lamprecht <[email protected]> wrote:

> Am 18.11.25 um 16:15 schrieb Stoiko Ivanov:
> > the validation regex in pve-common is:
> > `/^[a-z][a-z0-9_]{1,20}([:\.]\d+)?$/` [0]  
> 
> Recently re-checked this patch, as when adding some tests for this, the
> behavior of allowing uppercase characters for all but the first one 
> seemed strange given above regex.
> 
> But this isn't the real regex though, as that would require all lowercase,
> not just the first character. The real regex as linked by [0] has a
> case-insensitive flag applied, so the case limitations of your patch suggest
> are overly strict compared to what pve-common accepts.
> It can be fine to be a bit more restrictive here, but lets not justificate
> doing so with a wrongly quoted validation regex.
> 
Thanks for catching this! as my previous attempts at getting this in sync
with what pve-common does always missed something (and/or followed my
gut-feeling more than what the code in pve-common actually does) - I
copied the validation from pve-common:
https://lore.proxmox.com/pve-devel/[email protected]/T/#t



_______________________________________________
pve-devel mailing list
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to