I have code that searches a folder that contains SQL patch files. I want to add file names to an array if they match the following name format:
number-text-text.sql
What Regex would I use to match number-text-text.sql?
Would it be possible to make the Regex match file names where the number part of the file name is between two numbers? If so what would be the Regex syntax for this?
The following regex make it halfway there:
Regarding to match in a specific range it gets trickier as regex doesn’t have a simple way to handle ranges. To limit the match to a filename with a number between 2 and 13 this is the regex: