Page 1 of 1

IF Condition File Name Pattern

Posted: Thu Aug 18, 2016 3:14 pm
by dchmax
I have an IF statement condition that I'm trying to put together that will look at a file name and determine if it has a specific pattern starting pattern.

ex.
File Name: 483_329_XP_STUFF_STUFF.xml

So I'm looking for - ###_###_??*.xml

This is what I have so far but its not working.

${StartsWith(CurrentItem:name,'###_###_??_')}

Thank you

Re: IF Condition File Name Pattern

Posted: Tue Sep 03, 2019 7:28 am
by mgable
Try ${IsValidText(text, regex)}

Sample: ${file:name} = Report_Aug-2019.csv

If: ${IsValidText(file:name, 'Report_[a-zA-Z][a-zA-Z][a-zA-Z]-20[0-9][0-9].csv')}
<Matches>