문제

Have come up with the following Finite State Machine for validating an email based on the following pattern. Is this valid to be able to validate an emailaddress format (more specifically, is the FSM a correct translation of the regex below)?

enter image description here

Further, even when valid, the stages S4 and S5 can be removed (repeating states) and instead S1 can be an accepting state?

Email address format example: abc23ss@1domain.ext

Regex as a base for drawing the FSM: [a-z0-9]+@[a-z0-9]+\.[a-z0-9]+

도움이 되었습니까?

해결책

I guess it's not a bad starting point, but it's not quite there yet, and you will have to revise your FSM quite a bit. For example, the following email address would be invalid according to your FSM:

some-thing.someone@somewhere.co.uk
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top