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

[REBOL] Re: Rebol "Find/whole" suggestion

From: hallvard:ystad:helpinhand at: 8-Mar-2002 21:41

Dixit Terry Brownell (19.15 08.03.2002):
>Aye, that works, but then requires parsing n, perhaps for the second time, >which can be slow, especially on really really big docs. I prefer inserting >and appending a space to the word... >a: "book" >insert a " " append a " " >n: "This is a bookmark" >find n a >== none
Well, but: nn: "But this is a book; this is yet another book, and finally, this is a book" a: "book" insert a " " append a " " find nn a == none So you probably shouldn't add spaces, but parse with a charset! that's the complement of all letters that may constitute a word. And finally check if the string starts or ends with the word you're looking for. ~H