f-981229-23

ldmud-3.2.9/src/bugs/f-981229-23 · 698 B

From the archive ldmud-329.tar.gz

Download the archive   « Back to the archive contents

Short: modified regexplode()
From: Dave Setty <garpoz@locallink.net>
Date: Thu, 10 Dec 1998 02:03:04 -0500
Type: Feature
State: Unclassified

2) A patch for regexplode which gives it an option not to include the
   matched parts of the input string in the return array. Useful for
   parsing some types of input. (regexplode(str, " *, *", 1))


Matthew Julius explains:

varargs string *regexplode(string, string, int)
  Allow an optional third argument to filter out matching or non matching
  pieces of the expression.
  For examples,
    regexplode("abc", "a.") returns ({ "", "ab", "c" })
    regexplode("abc", "a.", 1) returns ({ "", "c" })
    regexplode("abc", "a.", 2) returns ({ "ab" })


Site Stats

Snippets: 1791
Codebases: 571