lua-users home
lua-l archive

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

KHMan <> writes:
> Or something similar. Then use regular expressions to parse the
> line, perhaps using string.gmatch or something like that. A simple
> regex would be "[^,]+".

BTW, once you go beyond the most simple patterns, try learning LPeg --
it has something of a learning curve, but it's _really_ expressive and
easy to use once you get your head around it, and very powerful.

LPeg also seems a little faster than using lua's builtin regexp stuff,
and usually the lpeg grammar can be quite precise (whereas using regexps
I usually find it necessary to be somewhat sloppy).


Next to fried food, the South has suffered most from oratory.
  			-- Walter Hines Page