attractivechaos / plb

Programming language benchmarks
http://attractivechaos.github.com/plb/
272 stars 57 forks source link

Update patmch_v1.d #34

Open mikey-b opened 8 years ago

mikey-b commented 8 years ago

Rewritten to give D a strong chance at the benchmark. Unfortunately, there are some limitations to the D regex regarding encoding (As you found). https://dlang.org/phobos/std_regex.html#Unicode%20support

You can clean the howto file with iconv -f iso-8859-1 -t utf-8 howto > howto2

Line 12 can be rewritten with a compile-time generated Regex engine, auto re = ctRegex!(r"([a-zA-Z][a-zA-Z0-9]*)://([^ /]+)(/?[^ ]*)"); if you feel it fair to sacrifice the command-line pattern option.