I want to parse the strings, so that to check whether they have specified syntax or not.
Example:
Str = Z344-R565l t
Here my requirement is after Z there should be a number and after that a - and after that R should be there followed by a number, followed by l, followed by a space and then finally t.
If any thing other than this it should be a error.
I have to parse many different kind of syntax like this. I would be awkward if write a function for each type of syntax required. I heard that yacc or lex can solve this problem.
Can any one please throw some light on my problem?