I am trying to clear something that seems to be a little misleading for me.

I know the language over {a,b} consisting of all words containing the same number of occurrences of

the symbol a as of the symbol b is not regular.

I know that the language L over {a,b} consisting of all words containing

the same number of occurrences of ab as a substring as occurrences of ba as a substring

actually is regular.

What would be the best way to prove the sub string language??

by finding a finite automaton that accepts this language? or have i got the wrong idea?

Hope someone can point me in the right direction.