AltME: Parse


We have a company/restaurant in Holland that is called Keuk& (translation Kitchen). Otoh the amp is not allowed in urls is it?
An idea might be to hardcode these few examples and transform them in an extra parse step, or just before returning the value from the db.
(forget the remark about url and &).
yes.. Nick
I will have to scan all the "&" and compare this with html entities (&, ´) if those two words between '&', I have to keep those words and replace '&' with "&".
I was trying to make a patch to web-to-plain.r from

@Rondon   would love to see what you come up with, web-to-plain.r  changes web encoded chars to accii plaintext so emitting an "&amp" in place of an "&" in the input would be counter to its nature.  maybe describe the problem a bit more, what the input is and what needs to be changed in the output.  Just looking at it now (after a decade) I think I would at least change the call from parse to parse/all

How do I use NOT in PARSE in R2?
;On R3
>> parse "a" [not "b" skip]
== true
On R2?
Is 'not availabe in terms of R2 parse at all?
Better asking; how do I do on R2 something like:
PARSE/all "abc" ["a" not "x" "c"]  ;==true
@Perk: No, unfortunately not.
>> parse "x" [not "a"]
** Script Error: Invalid argument: ?native?
Normally I won't compare with one char, so using a complemented charset is not useful for me.
not-a: complement charset "a"
parse/all "x" [not-a] ; == true
Won't this work?
>> not-x: complement charset "x"
>> parse "abc" ["a" not-x "c"]
== true
>> parse "axc" ["a" not-x "c"]
== false
Geomol just beat me to that :-)
:-) I beat you both :P
Why is complemented charset not useful?
Because I need to NOT a word.
Something like:
>> parse/all "this" [some ["this" (print "ok" halt) | skip] ]
>> parse/all "this" [some ["that" (print "ok" halt) | skip] ]
== true
But I don't know how to stop PARSE in the first example.
Instead of HALTing.
to end 1 skip
Which will always return false, I think.

Last message posted 149 weeks ago.