Split String using the regular expression Pattern. Split
is a list of strings holding alternating matches of Pattern
and skipped parts of the String, starting with a skipped
part. The Split lists ends with a string of the content of String
after the last match. If
Pattern does not appear in String, Split
is a list holding a copy of
String. This implies the number of elements in Split
is always odd. For example:
?- re_split("a+", "abaac", Split, []).
Split = ["","a","b","aa","c"].
?- re_split(":\\s*"/n, "Age: 33", Split, []).
Split = ['Age', ': ', 33].
Pattern | is the pattern text, optionally
follows by /Flags. Similar to re_matchsub/4,
the final output type can be controlled by a flag a (atom), s
(string, default) or n (number if possible, atom
otherwise). |