[DGD] 1.2.31

Mikael Lind z94lind at mtek.chalmers.se
Thu Sep 27 15:39:52 CEST 2001


Quoting Felix A. Croes from 20:39, 2001-09-26:

> A word of caution about the nomatch token rule: this is a fallback rule
> for the case when nothing else matches.  A possible match of all other
> tokens will have been attempted at every position in a nomatch string,
> so this can get very inefficient.  [...]

Still, would not the nomatch token rule be a good way to implement
regexplode(), recently discussed on this list?

static string *regexplode(string str, string delimiter) {
    return parse_string("whitespace = /" + delimiter + "/\n"
                        + "text = nomatch\n"
                        + "TEXT: text TEXT\n"
                        + "TEXT:", str);
}

// Mikael / Elemel

_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list