filter files with more than one extension

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

filter files with more than one extension

Post by Mag » Thu Oct 06, 2016 5:55 pm

I have a list of sound files .wav and .m4a, I would like to have both kind listed, I saw that this code works:

Code: Select all

put the files into soundListFiles
filter soundListFiles with ".wav"
I haven't find how to include two types. Obviously this don't works:

Code: Select all

filter soundListFiles with ".wav|*.m4a" -- don't work
:lol:

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: filter files with more than one extension

Post by Thierry » Fri Oct 07, 2016 7:29 am

Mag wrote:I have a list of sound files .wav and .m4a, I would like to have both kind listed
This works:

Code: Select all

filter lines of soundListFiles with regex pattern "\.(wav|m4a)$"
Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

Post Reply