Skip to content

Commit 7732d50

Browse files
authored
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 %"
1 parent d7e5dc3 commit 7732d50

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

archinstall/lib/disk/partitioning_menu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ def _validate_value(
437437
max_size: Size,
438438
text: str,
439439
) -> Size | None:
440-
match = re.match(r'([0-9]+)([a-zA-Z|%]*)', text, re.I)
440+
match = re.match(r'^\s*([0-9]+)\s*([a-zA-Z%]*)\s*$', text, re.I)
441441

442442
if not match:
443443
return None

0 commit comments

Comments
 (0)