I want to integrate a regex into my process that would allow checking the name of a file:
Example:
Log_rapport_OVE1_20251014_202118.zip
In this file name, I would like to check the presence of these three criteria:
Prefix “Log”
Presence of the date that will be a variable (“20251014”)
Ok. I got it now. Then you can use the following logic:
Dim pattern As String = "Log_.*_" & yourDate & "_\d{6}\.zip"
If System.Text.RegularExpressions.Regex.IsMatch(fileName, pattern) Then
isValid = True
Else
isValid = False
End If