News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.

Post Reply  Post Thread 
match one of three possible substrings?
Author Message
Senior Member

Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #1
match one of three possible substrings?

It doesn't look like this is possible, but i'm often wrong =o)
In Bash you can use *.{png,jpg,gif} to match any of 3 possible filename extensions.
Can this be done in Lua?
What I have right now works, but it seems terribly redundant:

for i=1,table.getn(allfiles) do
if string.find(allfiles[i],"%.png$") or string.find(allfiles[i],"%.jpg$") or string.find(allfiles[i],"%.gif$") then

Thanks for reading.

06-10-2007 05:33 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
match one of three possible substrings? - mikshaw - 06-10-2007 05:33 AM

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: