Compiler code

In the code compilers and parsers in may long challenge, we need to find the maximum length of valid expression which occurs continuously as a seried without any invalid character in between OR we need to sum up all the valid expressions wheresoever they may be.
eg. <><<> should return 2 or 4?
If you cant tell the soln of this, just clarify my doubt.

did you miss the word “prefix”.See the question statement again.

the problem statement is clear!!!

So output of <><>><><><> is 4 @princelegolas?