First example is inspired from this article : http://continuations.com/post/65432407939/tech-tuesday-finite-state-machines-continued
Verify if the input string consisting of only two letters “a” and “b” and has exactly only one “b” in them.
Example:
abaa -> ok
abbaa -> not ok
Second example tests if the input is a palindrome, as this example, or
not :
abba -> ok
abbaa -> not ok!
provided by Intersel