aboutsummaryrefslogtreecommitdiffstats
path: root/gsxws/core.py
diff options
context:
space:
mode:
Diffstat (limited to 'gsxws/core.py')
-rw-r--r--gsxws/core.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/gsxws/core.py b/gsxws/core.py
index 5c771af..548e17b 100644
--- a/gsxws/core.py
+++ b/gsxws/core.py
@@ -108,6 +108,8 @@ def validate(value, what=None):
True
>>> validate('ZM661-5883', 'partNumber')
True
+ >>> validate('661-01234', 'partNumber')
+ True
>>> validate('B661-6909', 'partNumber')
True
>>> validate('blaa', 'serialNumber')
@@ -121,7 +123,7 @@ def validate(value, what=None):
raise ValueError('%s is not valid input' % value)
rex = {
- 'partNumber': r'^([A-Z]{1,2})?\d{3}\-?(\d{4}|[A-Z]{1,2})(/[A-Z])?$',
+ 'partNumber': r'^([A-Z]{1,2})?\d{3}\-?(\d{4,5}|[A-Z]{1,2})(/[A-Z])?$',
'serialNumber': r'^[A-Z0-9]{11,12}$',
'eeeCode': r'^[A-Z0-9]{3,4}$',
'returnOrder': r'^7\d{9}$',