AltME: Parse

Messages

Gabriele
>> parse {a,b,c} ","
== ["a" "b" "c"]
>> parse {a,b,c d} ","
== ["a" "b" "c" "d"]
>> parse {a,b,"c d"} ","
== ["a" "b" "c d"]
>> parse {a,b,"c d,e"} ","
== ["a" "b" "c d,e"]
note also:
>> parse/all {a,b,c d} ","
== ["a" "b" "c d"]
>> parse/all {a,b,c,d} ","
== ["a" "b" "c" "d"]
>> parse/all {a,b,"c,d"} ","
== ["a" "b" "c,d"]
sqlab
Just at what I wanted to point

Geomol
Would it makes sense to let
    parse "abc" [3 char!]
be the same as
    parse "abc" [3 skip]
Geomol
Maybe letting this be true is better:
    parse "abc" [word!]
Like this is true:
    parse "123" [integer!]

DocKimbel
Your opinion is welcome: COMMENT in PARSE
https://github.com/red/red/issues/724
Andreas
Related CureCode issue for COMMENT in PARSE:
http://issue.cc/r3/1966
Gregg
Opinion posted.

Rondon
Hi Folks, I'm having problem to parse the '&' commercial symbol. I'm using web-to-plain.r from rebol.org, but the 'Inc names, I'm having problem to parse it.. any clues ?
My problem is because I have some html entities starting with &, but the problem is to find just companies such as AT&T, A&E, Film&Arts and transform this  loner '&' to '&'

NickA
Rondon, so, the company names are always sandwiched between two other characters -is that correct?  Are the html entities always characterized by a different matching pattern (not sandwiched the same way)?
Arnold
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 &).
Rondon
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 "&".
Rondon
I was trying to make a patch to web-to-plain.r from rebol.org

Tomc
@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

Endo
How do I use NOT in PARSE in R2?
;On R3
>> parse "a" [not "b" skip]
== true
On R2?
Pekr
Is 'not availabe in terms of R2 parse at all?
Endo
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?

Last message posted 45 weeks ago.