
Regex represents a regular expression.
Slots
- equals
-
Equality is based on pattern string.
- fromStr
-
new fromStr(Str pattern)
Compile a regular expression pattern string.
- hash
-
override Int hash()
Return
toStr.hash
. -
new make()
Private constructor.
- matcher
-
RegexMatcher matcher(Str s)
Return a
RegexMatcher
instance to use for matching operations against the specified string. - matches
-
Convenience for
matcher(s).matches
. - split
-
Str[] split(Str s, Int limit := def)
Split the specified string around matches of this pattern. The
limit
parameter specifies how many times to apply the pattern:- If
limit
is greater than zero, the pattern is applied at mostlimit-1
times and any remaining input will be returned as the list's last item. - If
limit
is less than zero, then the pattern is matched as many times as possible. - If
limit
is zero, then the pattern is matched as many times as possible, but trailing empty strings are discarded.
- If
- toStr
-
override Str toStr()
Return the regular expression pattern string.