RegEx for tv5XXXX

Hello Experts,

This is regarding framing RegEx for the likes 'tv5XXXX'.
Their are directories under say 'myFolder/' with names like:

 
tv5abc1
tv5abc2
tv5jkh6
tv5jkhi
.
.

and others out of my concern. I want to list all the directories of my required type. Their name must fulfill the following condition:

  1. begin with 'tv5'
  2. contain no special character, only alphanumeric
  3. 'tv5' can be followed by 4 alphabets(eg tv5abcd) or 3 alphabets and the last one, a digit(eg tv5abc2).

I made the following towards achieving the solution:

 
ls -l | awk '{print $9}' | grep "^\(tv5[a-z]\{3,4\}[0-9]\{1\}\)$"

The above snippet lists the likes of tv5ebc1, tv5abc2 etc. and not tv5abcd because it looks for a number in the end.

What I think the solution to be is :

 
ls -l | awk '{print $9}' | grep "^\(tv5[a-z]\{3\}{--either a digit or an alphabet--}\)$"

Please provide some hints to help me.

Thank You.

Regards

I wonder how I missed it.
[0-9a-z]

Problem resolved, I believe.

Final Solution:

 
ls -l | awk '{print $9}' | grep "^\(tv5[a-z]\{3\}[0-9a-z]\)$"

Still, if you find a test case I might have missed, please help me recognise it.

Thank You.

Regards

PS: I'll post the complete script for review and reference as soon as it is complete.