rule: [while [not ["--"] skip] some "-"]
parse "a-bc----d" [rule ??]
prints
??: "d"
But I need a more efficient rule (e.g. using to #"-"
)...
EDIT:
t: copy "" append/dup t "." 10000 append t "-..---..--"
rule: [while [not ["--"] skip] some "-"]
print [delta-time [loop 1000 [parse t [rule] ]]]
=> ~ 15.4 sec on my phone
rule: [any ["--" break | skip] any "-"]
=> ~ 8.2 sec
rule: [to "--" some "-"]
(@sqlab response)
=> ~ 0.3 sec