Skip to content

Extracting multiple data with parse #93

Answered by Oldes
SebastianMpl asked this question in Q&A
Discussion options

You must be logged in to vote
nums: "34 56 83 19"
digits: system/catalog/bitsets/numeric
parse nums [collect any [keep some digits | skip]]
;== ["34" "56" "83" "19"]

or in your case:

ints: copy []
rules: [some [copy int some digits (append ints int)| skip]]
parse nums rules
ints
;== ["34" "56" "83" "19"]

Your error is, that you are appending just the last int, having (append ints int) outside the some block.

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@SebastianMpl
Comment options

Answer selected by SebastianMpl
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants