Hello!
Given:
text : String
text = "this is some text with some-id 123 and this is the object-id 159 and some other text and one person-id 89 and so on..."
type alias Extracted =
{ beforeObjectId: String
, objectId: Int
, beforePersonId: String
, personId: Int
, afterPersonId: String
}
I want to parse str
to build Extracted
.
My current approach is to find “object-id” (String.find
), split it, parse the Int, and do the same for the person-id. But maybe this can be done with a parser? But I haven’t found a solution on how to parse until a given keyword (object-id).
Regards,
Niko