### Get Filelist by Extension

Example of getting list of files by extension from a folder.
Sub
`Sub GetFilesByExt(folder As String, ext As String) As List
Dim l As List
l.Initialize
Dim fl As List = File.ListFiles(folder)
For i = 0 To fl.Size - 1
Dim m As Matcher = Regex.Matcher("(\w+)." & ext, fl.Get(i))
If m.Find = True Then l.Add(m.Match)
Next
Return l
End Sub`
Example
'Get jar files
Dim l As List = GetFilesByExt(File.DirApp, "jar")
Log(l.Size)
Output Example
1
'Get all files in a folder
Dim l As List = GetFilesByExt(File.DirApp, "*")
Log(l.Size)
Output Example
4

Changed: , Category: Matcher, File: T6C218M1604.htm, ID: 1604