On Saturday, 22-September-2007 at 17:22:49 Tom wrote,
>minutely faster than trim/with
>
>digit: charset "0123456789"
>noise: complement digit
>start: now/time/precise
>rule: [digit | here: some noise there:(remove/part :here :there) :here]
>loop 1'000'000 [parse/all "(250) 764-0929"[some rule]]
>now/time/precise - start
Ahah! I'm finding it minutely slower...
remove-each...
0:00:08.734
trim/with...
0:00:02.203
remove-each using bitsets...
0:00:07.032
parse...
0:00:02.265
but still an excellent advert for parse. And unlike trim, it doesn't easily
break...
>> str: ""
== ""
>> loop 50 [append str to-char random 255]
== {^!Ù×V^[Ùl¬w×GÏp×f~<8~^S|U#^Qº|o$]O¤y/#|Y^\j¸eü!}
>> loop 1'000'000 [parse/all str [some rule]]
== true
>> str
== "8"
So Kai - up to you for the real-world results, though parse looks to be the
best choice.
-- Carl Read.
--
To unsubscribe from the list, just send an email to
lists at rebol.com with unsubscribe as the subject.