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

Parse question

 [1/3] from: semseddinm:bircom at: 19-Mar-2010 14:20


Hi, how do I extract just valid items or skip invalid ones using parse: blk: [1 "a" 2 "b"] ;there are 2 valid values
>> parse blk [some [integer! string! (print "ok")]]
ok ok
>> blk: [1 "a" 1.2.3 2 "b"] ;there is an invalid item 1.2.3 >> parse blk [some [integer! string! (print "ok")]]
ok == false How do I say, take the valid ones, just like in regular expressions?

 [2/3] from: sqlab:gmx at: 19-Mar-2010 13:52


Hi Şemseddin,
>> parse blk [some [[integer! string! (print "ok")] | skip ]]
ok ok == true but this works only as long as you use items according the Rebol syntax rules. On 19.03.2010 13:20, Şemseddin Moldibi wrote:

 [3/3] from: semseddinm:bircom at: 19-Mar-2010 15:00


that is great, thanks a lot. Fri, 19 Mar 2010 14:52:54 +0200 tarihinde sqlab <sqlab-gmx.net> şöyle yazmış: