I am having some files in a folder as follows:
ss1.txt, ss2.txt, .., ss9.txt, ss10.txt, ss11.txt, .., ss19.txt, ss20.txt
.
When I tried to fetch these files using preg_match, I got the result in the order:
ss1.txt, ss10.txt, ss11.txt, ... ss19.txt, ss2.txt, ss20.txt
.
What I need exactly is as follows:
ss1.txt, ss2.txt, .., ss9.txt, ss10.txt, ss11.txt, .., ss19.txt, ss20.txt
.
The expression that I am using is as below:
'/_ss[1-9]+\.txt/'