質問

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