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

[REBOL] 5 simple pattern matching questions

From: princepawn:mailandnews at: 15-Sep-2000 2:53

I am having problems switching my understanding of regular expressions to the REBOL parse dialect. Could someone please tell me how to do each of the following with parse? 1. match "cat" at the beginning of a line 2. match "cat", immediately preceded and followed by a word boundary , e.g., match "the cat in" or "the cat" but not "mercata" 3. match "cat" on a line all by itself 4. match the empty string: I think this is parse string "" 5. match any char: I think this is done by creating a bitset from a charset from hex 000 to hex 255 and parsing on that, but it doesnt work, e.g., bset: charset [ #"^(00)" - #"^(FF)" ] parse " " [ some bset ] fails