Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] small parse problem Re:(2)

From: rryost:home at: 16-Sep-2000 10:50

Here's simple function that gets you part way: A console session follows:
>> u1: "www.somewhere.com&blah-blah"
== "www.somewhere.com&blah-blah"
>> u2: "www.somewhere.com-extrapathbit&blah-blah"
== "www.somewhere.com-extrapathbit&blah-blah"
>> chpurl: func [s[string!]][
[ parse first parse s "&" "-"]
>> chpurl u1
== ["www.somewhere.com"]
>> chpurl u2
== ["www.somewhere.com" "extrapathbit"]
>>
Outlook express has inserted underlines for the URL's above; ignore them. Also, the >> and [ above at the start of the lines are console session prompts. Russell [rryost--home--com] Russell [rryost--home--com]