P开发者_开发百科arsec's parse pattern "(some_input)" input
returns the parsed data (as I specified in pattern
.
How to know how much of input
have it consumed (the pattern is not anchored with eof)? I don't want to add length tracking though the all pattern
's internals (if discards some parts of input).
- It is not easy with Parsec;
- If it is needed to skip header you can grab the rest of input using
getInput
; - May be other parser libraries can do this.
(the answer is based on comments to the question)
精彩评论