You probably want this regular expression:
[a-zA-z][a-zA-z0-9]*\.[a-zA-z0-9]+-[a-zA-z0-9]+$
Parsing:
[a-zA-z]
The first match is in English ( az lowercase, AZ uppercase).
[a-zA-z0-9]*
Then there can be any number ( * means from 0 to infinite) of English letters ( a-zA-Z ) or numbers ( 0-9 )
\.
Then you need to be a point (literally).
[a-zA-z0-9]+
Then again, any number of English letters or numbers, but now at least one of these signs ( + means from 1 to infinite).
-
Literally this minus sign ( - )
[a-zA-z0-9]+
This is already known (see above).
$
Then there can be nothing else ( $ means the end of the line).
Notes:
You may also want to start at the beginning of the line:
^[a-zA-z][a-zA-z0-9]*\.[a-zA-z0-9]+-[a-zA-z0-9]+$
( ^ means c start).
It is safer to use r before a regular expression:
pattern1 = re.compile(r'[a-zA-z][a-zA-z0-9]*\.[a-zA-z0-9]+-[a-zA-z0-9]+$')
["."]must be replaced by\.- Wiktor Stribiżew