Validates if the given regular expression matches the given string.
- actual (String)
- The string to match.
- regex (Regex)
- The regular expression to match.
- message (String)
- The message to log. "{0}" is replaced by the string representation of actual, "{1}" by the string representation of regex.
- exceptionOnFail (Boolean)
- A value specifying if an exception should be thrown if the validation fails.
True if regex matches actual;
otherwise false.
| Exception | Condition |
|---|---|
| ArgumentNullException | If regex is null. |
| ValidationException | If the validation fails and
exceptionOnFail is true. |
