Improved regex in _validate_value() that checks user input for partition value and unit. (#3952)

- Allows for white space in between groups, aligning better with displayed example.
- Removed unneeded | symbol, which was checking as literal rather than working as "or %"
This commit is contained in:
Gabriel A Hernandez 2025-11-28 16:04:39 -08:00 committed by GitHub
parent d7e5dc3692
commit 7732d50016
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -437,7 +437,7 @@ class PartitioningList(ListManager[DiskSegment]):
max_size: Size,
text: str,
) -> Size | None:
match = re.match(r'([0-9]+)([a-zA-Z|%]*)', text, re.I)
match = re.match(r'^\s*([0-9]+)\s*([a-zA-Z%]*)\s*$', text, re.I)
if not match:
return None