Function RegEx(strText, strPattern) 'As Boolean 'Returns true if strText matches strPattern '"Map0000.xls"="^[m|M][a|A][p|P]\d\d\d[m|M]\.(xls|XLS)$" Dim rx Set rx = New RegExp rx.Pattern = strPattern rx.IgnoreCase = False RegEx = rx.Test(strText) End Function