Mad Libs: Difference between revisions

Simpler regex in D entry
(+ D)
(Simpler regex in D entry)
Line 222:
writeln("\nInput a comma-separated list of words "
"to replace the following items:");
auto re = regex("<[^>].+?>", "g");
auto fields = story.match(re).map!q{a.hit}().array().sort().uniq();
writef(" %s: ", fields.join(","));