const class sys::Regex

sys::Obj
  sys::Regex

Source

Regex represents a regular expression.

equals

virtual override Bool equals(Obj? obj)

Source

Equality is based on pattern string.

fromStr

const static Regex fromStr(Str pattern)

Source

Compile a regular expression pattern string.

glob

const static Regex glob(Str pattern)

Source

Make a Regex which will match a glob pattern:

  • "?": match one unknown char (maps to "." in regex)
  • "*": match zero or more unknown char (maps to ".*" in regex)
  • any other character is matched exactly
hash

virtual override Int hash()

Source

Return toStr.hash.

matcher

RegexMatcher matcher(Str s)

Source

Return a RegexMatcher instance to use for matching operations against the specified string.

matches

Bool matches(Str s)

Source

Convenience for matcher(s).matches.

split

Str[] split(Str s, Int limit := 0)

Source

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 most limit-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.
toStr

virtual override Str toStr()

Source

Return the regular expression pattern string.