F Firpas Active Member Licensed User Longtime User Apr 14, 2016 #1 How to apply a mask filter (like "My*.tx?", or "*.txt", or any other one) to a File.Listfiles ?? Perhaps applying Regex.IsMatch, but ... how? taking into account the many possible combinations of "*" and "?" Thanks in advance
How to apply a mask filter (like "My*.tx?", or "*.txt", or any other one) to a File.Listfiles ?? Perhaps applying Regex.IsMatch, but ... how? taking into account the many possible combinations of "*" and "?" Thanks in advance
B billzhan Active Member Licensed User Longtime User Apr 14, 2016 #2 You have to learn the RE syntax. Online regex tool for testing: http://basic4ppc.com:51042/regex/index.html Upvote 0
You have to learn the RE syntax. Online regex tool for testing: http://basic4ppc.com:51042/regex/index.html
Erel B4X founder Staff member Licensed User Longtime User Apr 14, 2016 #3 Something like: Code: Copy Dim filteredList As List filteredList.Initialize For Each s As String In File.ListFiles(...) If Regex.IsMatch ("My.*\.tx.", s) Then filteredList.Add(s) '*.txt => .*\.txt Next Upvote 0
Something like: Code: Copy Dim filteredList As List filteredList.Initialize For Each s As String In File.ListFiles(...) If Regex.IsMatch ("My.*\.tx.", s) Then filteredList.Add(s) '*.txt => .*\.txt Next
F Firpas Active Member Licensed User Longtime User Apr 14, 2016 #4 Thanks for your quick answer. I think I have not explained well in my previous post. What I want is to convert to a regex wildcard expression Upvote 0
Thanks for your quick answer. I think I have not explained well in my previous post. What I want is to convert to a regex wildcard expression
F Firpas Active Member Licensed User Longtime User Apr 14, 2016 #5 I think it's solved. I've attached a example project. Thanks for your colaboration. Attachments FileMatcher.zip FileMatcher.zip 2.4 KB · Views: 370 Upvote 0
DonManfred Expert Licensed User Longtime User Apr 15, 2016 #6 Maybe this is of use https://www.b4x.com/android/forum/t...-get-list-of-files-using-wildcards-iii.44922/ Upvote 0
Maybe this is of use https://www.b4x.com/android/forum/t...-get-list-of-files-using-wildcards-iii.44922/