TextDiff

TextDiff

splitby(reg, text)

Splits text at regex matches, returning an array of substrings. The parts of the string that match the regular expression are also included at the ends of the returned strings.

source