Hi,
I need to check that the filename is of the following format “TEST1_Complaints_" or "TEST2_Complaints_”. All other filename patters should be disregarded.
Please can anyone help with the regex query that is needed for this.
Hi,
I need to check that the filename is of the following format “TEST1_Complaints_" or "TEST2_Complaints_”. All other filename patters should be disregarded.
Please can anyone help with the regex query that is needed for this.
Hi,
How about the following?
System.Text.RegularExpressions.Regex.IsMatch(System.IO.Path.GetFileNameWithoutExtension(yourPath),"^TEST[12]_Complaints_.*")
Regards,
Thanks @Yoichi. This is working. If I want the filename to be case insensitive how should I do that?
Can you try the following expression?
System.Text.RegularExpressions.Regex.IsMatch(System.IO.Path.GetFileNameWithoutExtension(yourPath),"(?i)^TEST[12]_Complaints_.*")
Regards,
Thanks a lot @Yoichi. It worked.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.