Formal
Languages
and the
Theory of
Computation

Fall 2016
course
navigation

assignment 2 comments

Jim says

The coding parts were generally OK - you engaged the questions and said some reasonable things.
The regex piece generally felt somewhat sloppy :
I looked into the email spec, and can trivially prove that valid email addresses form a regular language: all valid emails are under 254 characters. Therefore the language is finite, and therefore regular.
The wikipedia argicle "email address" goes into some of the complications of email addresses. The definition and what's allowed has changed somewhat over time, which means it's messy to even decide what the spec is.
If "obsolete" forms are allowed, then it's the comments within brackets (comments in email addresses??) which can apparently be nested (??!?) which make it impractical to match with a regex. (See "validation and verfication" in the wikipedia article.)
The modern form an email address is pretty simple
localpart@domain
though localpart can have quoted strings and many other funky characters ... which not all email forms and what-not follow.
It might be worth talking about the email spec a bit, in part because it leads into our next grammar conversation.
http://cs.marlboro.edu/ courses/ fall2016/formal_languages/ notes/ assignment_2_comments
last modified Monday September 19 2016 2:41 pm EDT