本文介绍了重复PARSE规则以匹配至少2个空格的首次出现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

rule: [while [not ["--"] skip] some "-"]parse "a-bc----d" [rule ??]

rule: [while [not ["--"] skip] some "-"]parse "a-bc----d" [rule ??]

打印

??: "d"

但是我需要更有效的规则(例如使用to #"-")...

But I need a more efficient rule (e.g. using to #"-")...

t: copy "" append/dup t "." 10000 append t "-..---..--"rule: [while [not ["--"] skip] some "-"]print [delta-time [loop 1000 [parse t [rule] ]]]

t: copy "" append/dup t "." 10000 append t "-..---..--"rule: [while [not ["--"] skip] some "-"]print [delta-time [loop 1000 [parse t [rule] ]]]

=>在我的手机上〜15.4秒

=> ~ 15.4 sec on my phone

rule: [any ["--" break | skip] any "-"]

=>〜8.2秒

rule: [to "--" some "-"](@ sqlab响应)

rule: [to "--" some "-"] (@sqlab response)

=>〜0.3秒

推荐答案

是什么使您无法使用 to 作为

What prevents you to use to as e.g.

rule: [to "--" some "-"  x:]     

这篇关于重复PARSE规则以匹配至少2个空格的首次出现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-25 02:04