I have an exam question that I am unsure of the answer. The question is:
In organisation X valid user names have the following structure. The user name can be either the employee’s name followed by a colon and then the department name or a string of one or more alphanumeric letters consisting of lower case, upper case letters and digits from 0 to 9. All user names end with a period ("."). The employee’s name is expressed as ﬁrst name followed by an underscore and then the surname. The ﬁrst name and the surname must begin with an uppercase letter and is followed by an arbitrary number of lower case letters. All department names are an arbitrary number of lower case letters. Express the language for valid user names as a regular expression.
The answer I have is,
[A-Z][a-z]+"_"[A-Z][a-z]+":"[a-z]+"." | [A-Za-z0-9]+"."
The next question is:
Construct a deterministic ﬁnite state automaton for recognising the user names as described in Question 1.
For which I have this:
I am under the impression this is wrong because [A-Z] is a subgroup of [A-Za-z0-9] and a DFA cannot have the same symbol going from one state. Does anybody have an idea how to solve this / is it correct?