blob: 595e9dfdbf91d59726e2a38438188e9ca543864e [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
2 #include <regexp.h>
3
4 string *regexplode (string text, string pattern)
5 string *regexplode (string text, string pattern, int opt)
6
7DESCRIPTION
8 This function is similar to explode but accepts a regular
9 expression <pattern> as delimiter (interpreted according to <opt>
10 if given).
11
12 If flag RE_OMIT_DELIM is not set in <opt>, then every second element
13 in the result vector will be the text that matched the delimiter.
14 If the flag is set, then the result vector will contain only
15 the text between the delimiters.
16
17EXAMPLES
18 regexplode("abcdef", "cde") -> ({ "ab", "cde", "f" })
19 regexplode("abcdef", "cde", RE_OMIT_DELIM) -> ({ "ab", "f" })
20
21HISTORY
22 Introduced in 3.2@61
23 LDMud 3.3 added the optional <opt> argument and the RE_OMIT_DELIM
24 flag.
25
26SEE ALSO
27 explode(E), regexp(E), regmatch(E), regreplace(E),
28 regexp_package(E), regexp(C)