samedi 9 mai 2015

regex - camel case that doesnt contain consecutive uppercase letters

Consider the following description of identifiers: "Identifiers are alphanumeric, but must start with a lowercase letter and may not contain consecutive uppercase letters." Write a DFA that accepts these identifiers.

this is my regex that i will use to translate to the DFA but i dont think its correct

[a-z].( ([a-z0-9] | [a-z0-9][A-Z])* | ([a-z0-9] | [A-Z][a-z0-9])* )

Aucun commentaire:

Enregistrer un commentaire