It appears that the most recent patch to regexp:
2010-04-09 David Bateman <address@hidden>
* DLD-FUNCTIONS/regexp.cc (octregexp_list): Properly ignore
zero-length matches in named tokens.
causes the failure
[t, nm] = regexp("John Davis\nRogers,
James",'(?<first>\w+)\s+(?<last>\w+)|(?<last>\w+),\s+(?<first>\w+)','tokens','names');
assert (size(t), [1,2]);
assert (t{1}{1},'John');
assert (t{1}{2},'Davis');
assert (t{2}{1},'Rogers');
assert (t{2}{2},'James');
assert (size(nm), [1,1]);
assert (nm.first{1},'John');
assert (nm.first{2},'James');
assert (nm.last{1},'Davis');
assert (nm.last{2},'Rogers');
!!!!! test failed
assert (nm.first {2},'James') expected
James
but got
====================================
t looks correct, but nm.last{2} returns blank.
Anyhow, I get this failure using latest source on:
Linux godfrey-pbdsl3.stanford.edu 2.6.32.11-99.fc12.x86_64 #1 SMP Mon
Apr 5 19:59:38 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux
Michael