diff --git a/ShareX.HistoryLib/Forms/HistoryForm.cs b/ShareX.HistoryLib/Forms/HistoryForm.cs index 37684d6e2..00af465c2 100644 --- a/ShareX.HistoryLib/Forms/HistoryForm.cs +++ b/ShareX.HistoryLib/Forms/HistoryForm.cs @@ -30,6 +30,7 @@ You should have received a copy of the GNU General Public License using System.IO; using System.Linq; using System.Text; +using System.Text.RegularExpressions; using System.Windows.Forms; namespace ShareX.HistoryLib @@ -149,7 +150,9 @@ private HistoryItem[] ApplyFilters(HistoryItem[] historyItems) if (!string.IsNullOrEmpty(filenameFilter)) { - result = result.Where(x => x.Filename != null && x.Filename.Contains(filenameFilter, StringComparison.InvariantCultureIgnoreCase)); + string pattern = Regex.Escape(filenameFilter).Replace("\\?", ".").Replace("\\*", ".*"); + Regex regex = new Regex(pattern, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); + result = result.Where(x => x.Filename != null && regex.IsMatch(x.Filename)); } string urlFilter = txtURLFilter.Text;