Reputation: 21
I'm try to verify filenames with this schema: <letter>-<digits>.html
. For example, t-32782.html
or f-484774.html
. One letter then many digits then ".html".
Upvotes: 0
Views: 1084
Reputation: 10049
Don't know what flavor of regex you're using, but this should work for a number of them.
/^\w-\d+\.html$/
Upvotes: 1
Reputation: 15780
If the first letter is always lowercase:
/^[a-z]-[0-9]+\.html$/
If it can be lowercase or uppercase:
/^[a-zA-Z]-[0-9]+\.html$/
Upvotes: 1