How to write regex expression for particular format

hi , how to write a regex expression for below format.
2023-05-02_1269202_MembersListReport.xlsx
“YYYY-MM-DD_MemberGroupID_FileName.xlsx”
Here in this format only filename is fixed and file should be in xlsx fomat

Hi @Neha_Aggarwal1

If you want the file name you can use the below expression.
Store the file path in a variable called file path

- Assign -> Filename = Path.GetFilename(file path)

Hope it helps!!

Hi @Neha_Aggarwal1

Hope it helps!!

Hi,

\d{4}-\d{2}-\d{2}_\d{7}_MembersListReport.xlsx

Thank you

@Neha_Aggarwal1
Try this one:

Hi @Neha_Aggarwal1

Hope it helps!!

Hi @Neha_Aggarwal1

Try this

1 Like

“\d{4}-\d{2}-\d{2}\d+[A-Za-z]+.[xX][Ll][Ss][Xx]”

i am using this expression but it is working in below format also
“2023-05-02_1269202_MembersList.xlsx” As in this format Report is not mentioned in filename i,e after MembersList but also it is working fine not giving error.
i want this format 2023-05-02_1269202_MembersListReport.xlsx
“YYYY-MM-DD_MemberGroupID_FileName.xlsx”
Here in this format only filename is fixed and file should be in xlsx fomat

@Neha_Aggarwal1 Try this one:
Previous one was generic:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.