REBOL 3 Docs Guide Concepts Functions Datatypes Errors
  TOC < Back Next >   Updated: 3-Aug-2010 Edit History  

REBOL 3 Functions: charset

charset  chars  /length  len

Makes a bitset of chars for the parse function.


chars [string! block! binary! char! integer!]


/length - Preallocate this many bits

len [integer!] - Must be > 0

See also:

complement   char?  


The charset function is a shortcut for:

make bitset! value

It is used often for character based bitsets.

chars: charset "aeiou"
print find chars "o"
print find "there you go" chars
ere you go
digits: charset "0123456789"
area-code: ["(" 3 digits ")"]
phone-num: [3 digits "-" 4 digits]
print parse "(707)467-8000" [[area-code | none] phone-num]

  TOC < Back Next > - WIP Wiki Feedback Admin