NoRedInk/elm-formatted-text-19/1.0.0

FormattedText.Regex

Regex operations for FormattedText

type alias Match markup =
{ match : FormattedText markup
, index : Int
, number : Int
}

A match in a piece of FormattedText

This is the equivalent for FormattedTexts of Regex.Match for Strings. Unfortunately submatches cannot currently be supported when matching formatted texts.

contains : Regex -> FormattedText markup -> Bool

Check if a FormattedText contains matches with a regex. This is the equivalent of Regex.contains.

find : Regex -> FormattedText markup -> List (Match markup)

Find regex matches in a FormattedText. This is the equivalent of Regex.find.

Regex
-> (Match markup -> FormattedText markup)
-> FormattedText markup
-> FormattedText markup

Replace regex matches in a FormattedText. This is the equivalent of Regex.replace.

split : Regex -> FormattedText markup -> List (FormattedText markup)

Split a FormattedText on matches with a regex. This is the equivalent of Regex.split.