lua-users home
lua-l archive

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


Hello All,
i know this is something simple, so apologies.
I'm trying to collect all the words, control character, digits, etc.
from a text file. Like example file i have a c source file so to have
many of the possible character.
For example with this string (line):

    #include <sys/types.h>

I would like to have a collection (table) like this:

    1, line = 1, type = control, value = #
    2, line = 1, type = word, value = include
    3, line = 1, type = control, value = >
    etc.

My experiments until now are bad!
Any help is appreciated,
thanks,
ciao,
francesco.