SagaSaga
Standard Library

Std.Regex

Regular expression matching and replacement using POSIX-style patterns.

Functions

match

fun match : (pattern: String) -> (s: String) -> Bool

Returns True if the string matches the pattern.

find

fun find : (pattern: String) -> (s: String) -> Maybe String

Returns the first match of the pattern in the string, or Nothing.

find_all

fun find_all : (pattern: String) -> (s: String) -> List String

Returns all non-overlapping matches of the pattern in the string.

replace

fun replace : (pattern: String) -> (s: String) -> (replacement: String) -> String

Replaces the first match of the pattern with the replacement string.

replace_all

fun replace_all : (pattern: String) -> (s: String) -> (replacement: String) -> String

Replaces all matches of the pattern with the replacement string.