blob: ca67db826fce17adde5ed4297bafd30d7d66b30c [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
2 #include <regexp.h>
3
Zesstrab6ac9f62020-01-21 11:11:16 +01004 string * regexplode(string text, string pattern)
5 string * regexplode(string text, string pattern, int opt)
MG Mud User88f12472016-06-24 23:31:02 +02006
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
Zesstrab6ac9f62020-01-21 11:11:16 +010022 Introduced in 3.2@61.
MG Mud User88f12472016-06-24 23:31:02 +020023 LDMud 3.3 added the optional <opt> argument and the RE_OMIT_DELIM
24 flag.
Zesstrab6ac9f62020-01-21 11:11:16 +010025 Since 3.5.0 a error is raised if RE_PCRE is specified in <opt>, but
26 the driver lacks PCRE support.
MG Mud User88f12472016-06-24 23:31:02 +020027
28SEE ALSO
29 explode(E), regexp(E), regmatch(E), regreplace(E),
30 regexp_package(E), regexp(C)