MatchResult
classin packageklyn.regex
public class MatchResult
MatchResult

Represents one successful regular-expression match.

The current implementation stores the matched text. It can be compared directly with a String and converts back to the matched text through toString().

import klyn.regex

match = MatchResult("abc123")
assert match == "abc123"
print(match.value)      # abc123
Properties
Modifier and Type Member Description
public property value
value as String
Matched text.
Constructors
Modifier and Type Member Description
public MatchResult Creates a new match result from the matched text.
Methods
Modifier and Type Member Description
public override toString
toString() as String
Returns the matched text.
Operators
Modifier and Type Member Description
public static operator!=(left as MatchResult, right as MatchResult) as Boolean Value inequality with another match result.
public static operator!=(left as MatchResult, right as String) as Boolean Value inequality with a string.
public static operator!=(left as String, right as MatchResult) as Boolean Value inequality with a string.
public static operator==(left as MatchResult, right as MatchResult) as Boolean Value equality with another match result.
public static operator==(left as MatchResult, right as String) as Boolean Value equality with a string.
public static operator==(left as String, right as MatchResult) as Boolean Value equality with a string.