lua-users home
lua-l archive

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


> On Jan 25, 2006, at 20:38, Torsten Karwoth wrote:
> > =string.match("another.filename.with.extension.as.extension","^.*(%..*
> >) $")
>
> What about file names which start with ".", but don't have an extension
> (e.g. ".svn", ".DS_Store", etc )?
>
> What would be a good pattern to avoid those?
...
> Better alternatives?

string.match has a 3rd. argument, 'init' ;-)

string.match(filename, "^.*(%..*)$", 2) should do (not tested).

Bye,
   Torsten