MoreAsserts.AssertMatchesRegex Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| AssertMatchesRegex(String, String) |
Variant of |
| AssertMatchesRegex(String, String, String) |
Asserts that |
AssertMatchesRegex(String, String)
Variant of #assertMatchesRegex(String,String,String) using a
generic message.
[Android.Runtime.Register("assertMatchesRegex", "(Ljava/lang/String;Ljava/lang/String;)Ljava/util/regex/MatchResult;", "")]
public static Java.Util.Regex.IMatchResult? AssertMatchesRegex(string? expectedRegex, string? actual);
[<Android.Runtime.Register("assertMatchesRegex", "(Ljava/lang/String;Ljava/lang/String;)Ljava/util/regex/MatchResult;", "")>]
static member AssertMatchesRegex : string * string -> Java.Util.Regex.IMatchResult
Parameters
- expectedRegex
- String
The Java regular expression that must match the entire actual string.
- actual
- String
The string to match. A null string fails the assertion.
Returns
The match for the entire string, including its captured groups.
- Attributes
Remarks
Variant of #assertMatchesRegex(String,String,String) using a generic message.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
AssertMatchesRegex(String, String, String)
Asserts that expectedRegex exactly matches actual and
fails with message if it does not.
[Android.Runtime.Register("assertMatchesRegex", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/util/regex/MatchResult;", "")]
public static Java.Util.Regex.IMatchResult? AssertMatchesRegex(string? message, string? expectedRegex, string? actual);
[<Android.Runtime.Register("assertMatchesRegex", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/util/regex/MatchResult;", "")>]
static member AssertMatchesRegex : string * string * string -> Java.Util.Regex.IMatchResult
Parameters
- message
- String
The message to include if the assertion fails, or null for the default message.
- expectedRegex
- String
The Java regular expression that must match the entire actual string.
- actual
- String
The string to match. A null string fails the assertion.
Returns
The match for the entire string, including its captured groups.
- Attributes
Remarks
Asserts that expectedRegex exactly matches actual and fails with message if it does not. The MatchResult is returned in case the test needs access to any captured groups. Note that you can also use this for a literal string, by wrapping your expected string in Pattern#quote.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.