XCharacterSet Reference

XCharacterSet is an AppleScript library to provids a object which represent a character set. You can build a character set object using variety methods to specify a group of characters and passing a list of characters to the object.

You can check whether characters of a text are members of the XCharacterSet instance or not.

Exapmple

use XCharacterSet : script "XCharacterSet"

set a_charset to XCharacterSet's make_lower_alphabets()
log a_charset's is_member("abc1") -- false

a_charset's push_numerics()
log a_charset's is_member("abc1") --true

Constructors

make

Make an instance of XCharacterSet object.

make_with

Make an instance of XCharacterSet object given a character list.

make_whitespaces

Make an instance of XCharacterSet object for white spaces e.g. space and tab.

make_newlines

Make an instance of XCharacterSet object for new line characters e.g. return and line feed.

make_whites_newlines

Make an instance of XCharacterSet object for white spaces and new line characters e.g. space, tab, return and line feed.

make_numerics

Make an instance of XCharacterSet object for numerical characters i.e."0", "1", "2" ... "8", "9"

make_upper_alphabets

Make an instance of XCharacterSet object for upper alphabetical characters i.e."A", "B",...,"Y","Z"

make_lower_alphabets

Make an instance of XCharacterSet object for lower alphabetical characters i.e."a", "b",...,"y","z"

make_alphanumerics

Make an instance of XCharacterSet object for all alphabetical and numerical characters i.e."0"-"9", "a"-"z", "A"-"Z"

make_graphic_chars

Make an instance of XCharacterSet object for graphic characters i.e. characters in the range from 33 to 126 and characters in the range from 128 to 255.

Instance Methods

is_member

Check whether all characters of given text are members of the character set object or not

push

Append specified characters to the character set object

push_whitespaces

Append white spaces (space, tab) to the character set object.

push_newlines

Append new line characters (return, line feed) to the character set object.

push_numerics

Append numerical characters (0-9) to the character set object.

push_upper_alphabets

Append upper alphabetical characters (A-Z) to the character set object.

push_lower_alphabets

Append lower alphabetical characters (a-z) to the character set object.

push_controls

Append ascii control characters to the character set object. Control characters are in the range from 0 to 32 and 127.

push_characters_in_range

Append characters specified with a range of id to the character set object.

push_ascii_in_range

Append ascii characters specified with a range to the character set object.