Fix email validation and min and max validator

This commit is contained in:
YNH Webdev
2013-11-10 13:53:20 +01:00
parent 38f422896d
commit 1ec14ec397
3 changed files with 7 additions and 7 deletions

View File

@@ -19,7 +19,7 @@ feature {NONE} -- Initialization
make_email_validator (e: STRING) make_email_validator (e: STRING)
-- Initialize with specified error message which will be displayed on validation failure -- Initialize with specified error message which will be displayed on validation failure
do do
make_regexp_validator ("^[a-zA-Z0-9._%%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,6}$", e) make_regexp_validator ("^[a-zA-Z0-9._%%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$", e)
end end
end end

View File

@@ -5,11 +5,11 @@ note
revision: "$Revision$" revision: "$Revision$"
class class
WSF_max_VALIDATOR [G] WSF_MAX_VALIDATOR [G->FINITE[ANY]]
inherit inherit
WSF_VALIDATOR [LIST [G]] WSF_VALIDATOR [G]
redefine redefine
state state
end end
@@ -28,7 +28,7 @@ feature {NONE} -- Initialization
feature -- Implementation feature -- Implementation
is_valid (input: LIST [G]): BOOLEAN is_valid (input: G): BOOLEAN
do do
Result := input.count < max or input.count = max Result := input.count < max or input.count = max
end end

View File

@@ -5,11 +5,11 @@ note
revision: "$Revision$" revision: "$Revision$"
class class
WSF_MIN_VALIDATOR [G] WSF_MIN_VALIDATOR [G->FINITE[ANY]]
inherit inherit
WSF_VALIDATOR [LIST [G]] WSF_VALIDATOR [G]
redefine redefine
state state
end end
@@ -28,7 +28,7 @@ feature {NONE} -- Initialization
feature -- Implementation feature -- Implementation
is_valid (input: LIST [G]): BOOLEAN is_valid (input: G): BOOLEAN
do do
Result := input.count > min or input.count = min Result := input.count > min or input.count = min
end end