match class : Success getter
Description
Gets a value indicating whether a matching substring was found.
Syntax
matchInstance.Success
Arguments
None
Return value
Class | Description |
bool | A value indicating whether a matching substring was found. |
Sample code
1: | regex pattern = new regex("(b+)"); |
2: | match firstMatch= pattern.MatchM("aaabbbaaccc"); // "bbb"。 |
3: | bool success = firstMatch.Success; // true。 |
4: | pattern = new regex("(d+)"); |
5: | firstMatch= pattern.MatchM("aaabbbaaccc"); |
6: | success = firstMatch.Success; // false。 |
Notes
It's a wrapper of the System.Text.RegularExpressions.Match.Success property.