input4mips_validation.validation.regexp#
input4mips_validation.validation.regexp
#
Validation of values against regular expressions
DoesNotMatchRegexpError
#
Bases: ValueError
Raised when a value does not match a given regular expression, but it should
Source code in src/input4mips_validation/validation/regexp.py
__init__(value, regexp_to_match)
#
Initialise the error
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str
|
Value that should match |
required |
regexp_to_match
|
str
|
Regular expression that |
required |
Source code in src/input4mips_validation/validation/regexp.py
validate_matches_regexp(value, regexp_to_match)
#
Validate that a value matches a given regular expression
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str
|
Value to validate |
required |
regexp_to_match
|
str
|
Regular expression that |
required |
Raises:
| Type | Description |
|---|---|
DoesNotMatchRegexpError
|
|