Q: unix filename pattern in sftp command prompt Please help, I am new to unix, 
I want to read file which are available before 130000(hhmiss), meaning file from 00 hours to 13 hours. 
XYZ_20170504_{00,01,02,03,04,05,06,07,08,09,10,11,12}[0-5][0-9][0-5][0-9].csv

OR
XYZ_20170504_{13,14,15,16,17,18,19,20,21,22,23}[0-5][0-9][0-5][0-9]

Double digit pattern matching is not working for my case.
Examples
File pattern 1: XYZ_DATE_TIME.csv

I want to mget files from sftp server where twice a day.
String_yyyymmdd_hhmiss.csv
XYZ_20170514_035959.csv   

OR
XYZ_20170514_165959.csv


A: First of all in your question, i can see an error in your search regarding the dates. 
Your regex is looking for this
XYZ_20170504_
and your file contains this
XYZ_20170514_
So obviously these will never match. I think this is more like what you need
000000 to 125959
XYZ_20170514_(0[0-9]|1[0-2])[0-5][0-9][0-5][0-9].csv

OR
130000 to 235959
XYZ_20170514_(1[3-9]|2[0-3])[0-5][0-9][0-5][0-9].csv

Also this is a relatively quick fix, only looking for matches relating to the time. You should also look to further improve this so that you fully sure you are matching correctly on the dates also. 
For your own reference there are many tools available online to help you with your regular expressions and pattern matching. The one i favour most is regex101, however there are many others available too.
