really fix regex
parent
eb26202961
commit
76e8e8f6c7
|
@ -13,11 +13,15 @@ class OptRegexp < OptBase
|
|||
end
|
||||
|
||||
def valid?(value, check_empty: true)
|
||||
return false if check_empty && empty_required_value?(value)
|
||||
if check_empty && empty_required_value?(value)
|
||||
return false
|
||||
elsif value.nil?
|
||||
return true
|
||||
end
|
||||
|
||||
begin
|
||||
Regexp.compile(value)
|
||||
return true
|
||||
return super
|
||||
rescue RegexpError, TypeError
|
||||
return false
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue