 | ValidateAreEqual Method (String, Regex, String, Boolean) |
Validates if the given regular expression matches the given string.
Namespace:
Ranorex
Assembly:
Ranorex.Core (in Ranorex.Core.dll) Version: 12.7.4-git.38314c06
Syntaxpublic static bool AreEqual(
string actual,
Regex regex,
string message,
bool exceptionOnFail
)
Public Shared Function AreEqual (
actual As String,
regex As Regex,
message As String,
exceptionOnFail As Boolean
) As Boolean
Parameters
- actual
- Type: SystemString
The string to match. - regex
- Type: System.Text.RegularExpressionsRegex
The regular expression to match. - message
- Type: SystemString
The message to log. "{0}" is replaced by the string
representation of actual, "{1}" by the string representation
of regex. - exceptionOnFail
- Type: SystemBoolean
A value specifying if an exception should be
thrown if the validation fails.
Return Value
Type:
BooleanTrue if
regex matches
actual;
otherwise
false.
Exceptions| Exception | Condition |
|---|
| ArgumentNullException | If regex is null. |
| ValidationException | If the validation fails and
exceptionOnFail is true. |
See Also