lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 29/06/2012, at 10:34 AM, Daurnimator wrote:

> On 29 June 2012 08:07, Geoff Leyland <geoff_leyland@fastmail.fm> wrote:
> 
>> When you're parsing csv files, it would be useful to look for the end of a field with the pattern "[,$]" so that you can find the end of the last field as well as the ends of the previous fields.  Trouble is, this doesn't seem to work.
> 
> You can however use the frontier pattern, it'll match the start or end of a string as a null byte.
> So you can use %f[,%z]

Perfect.  Thanks.