f# - Parser identifiers and free format text. Can this be done with FParsec? -


as follow-on to: how test 2 characters fparsec?

i need parse string consists of pairs of identifiers followed freeform text. can construct parser finds identifiers of form of newline followed 2 uppercase characters followed space. freeform text, associated preceding identifier, following identifier not including next identifier.

so example:

ab time men. cd 4 score , 7 years ago ef our. 

contains 2 identifiers ab , cd , 2 pieces of freeform text

now \ntime men.
four score , 7 years ago ef our.

my problem don't know how construct parser match freeform text not match identifiers. case need backtracking?

can done , if how?

i think notfollowedby you're looking for. should trick:

// adapted other question let identifier = skipnewline >>. manyminmaxsatisfy 2 2 charparsers.isupper  let freeform = manychars (notfollowedby identifier >>. anychar) 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -