in reply to Re: Broken regexp
in thread Broken regexp

Some problems here. First, split ('|'), a classical mistake. That will split the string, at each and every character, as it's equivalent to split //. You mean split (/\|/).

Second, split never returns undefined fields. Fields can be empty, but they are still defined. You want to check on length here.

Third, this loses trailing empty fields. You want to give split a third, negative, argument.

Abigail