MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame^] | 1 | SYNOPSIS |
| 2 | #include <regexp.h> |
| 3 | |
| 4 | string *regexplode (string text, string pattern) |
| 5 | string *regexplode (string text, string pattern, int opt) |
| 6 | |
| 7 | DESCRIPTION |
| 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 | |
| 17 | EXAMPLES |
| 18 | regexplode("abcdef", "cde") -> ({ "ab", "cde", "f" }) |
| 19 | regexplode("abcdef", "cde", RE_OMIT_DELIM) -> ({ "ab", "f" }) |
| 20 | |
| 21 | HISTORY |
| 22 | Introduced in 3.2@61 |
| 23 | LDMud 3.3 added the optional <opt> argument and the RE_OMIT_DELIM |
| 24 | flag. |
| 25 | |
| 26 | SEE ALSO |
| 27 | explode(E), regexp(E), regmatch(E), regreplace(E), |
| 28 | regexp_package(E), regexp(C) |