Maple Professionel
Maple Académique
Maple Edition Étudiant
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professionel
MapleSim Académique
Maple T.A. - Suite d'examens de classement
Maple T.A. MAA Placement Test Suite
Möbius - Didacticiels de mathématiques en ligne
Machine Design / Industrial Automation
Aéronautique
Ingénierie des véhicules
Robotics
Energie
System Simulation and Analysis
Model development for HIL
Modélisation du procédé pour la conception de systèmes de contrôle
Robotics/Motion Control/Mechatronics
Other Application Areas
Enseignement des mathématiques
Enseignement de l’ingénierie
Enseignement secondaire et supérieur (CPGE, BTS)
Tests et évaluations
Etudiants
Modélisation financière
Recherche opérationnelle
Calcul haute performance
Physique
Webinaires en direct
Webinaires enregistrés
Agenda des évènements
Forum MaplePrimes
Blog Maplesoft
Membres Maplesoft
Maple Ambassador Program
MapleCloud
Livres blancs techniques
Bulletin électronique
Livres Maple
Math Matters
Portail des applications
Galerie de modèles MapleSim
Cas d'Etudes Utilisateur
Exploring Engineering Fundamentals
Concepts d’enseignement avec Maple
Centre d’accueil utilisateur Maplesoft
Centre de ressources pour enseignants
Centre d’assistance aux étudiants
StringTools[ExpandCharacterClass] - expand a character class to a string
Calling Sequence
ExpandCharacterClass( ccl )
Parameters
ccl
-
string; character class expression
Description
The ExpandCharacterClass(ccl) command expands character class expressions as described in the following section. These expressions are used to describe sets of characters in wildcard and regular expression patterns, but may be used for other purposes as well.
If the string ccl is a valid character class expression, then a string, with at most 255 characters, is returned that denotes literally the expressed character class.
Character Classes
In a character class expression, most characters denote themselves literally. For example, the character class expression denotes the character class consisting of the characters , and , which is represented by the string . Likewise, the string , interpreted as a character class expression, denotes the character class , the only difference being the order in which the characters are presented. By convention, literal character classes are returned in code point order.
If a character in a character class expression is preceded by a backslash, it is escaped, meaning that any special significance attached to it for character class expressions is suppressed (for that specific instance in the expression only).
The first and last characters in a character class expression can be open and close brackets ( and ), respectively. In this case, the expression is equivalent to the one obtained by removing the first and last characters. If either of the characters and appear anywhere but at the beginning and end, respectively, of the character class expression, they are taken literally. For example, is equivalent to .
Character Ranges
A consecutive range of characters is denoted by an interposed hyphen (). For example, represents the character class . The character to the left of the hyphen must precede the character to its right, in code point order. Thus, for example, is invalid.
Character literals and ranges may be juxtaposed in a character class expression. For example, is a valid character class expression which expands to the literal character class .
Negated Character Classes
If the first character in a character class expression is a caret () (or, if the character class expression is enclosed in brackets, and the caret follows the opening bracket), then the resulting character class is negated. This means that the character class expression expands to the set of characters not in the class described by the rest of the expression.
Named Character Classes
If the first and last characters of a character class expression are colons (), the character between them are taken to form the name of a named character class. Such an expression expands to the literal character class denoted by the named class.
The following named character classes are recognized.
alpha
alphabetic characters
alnum
alphabetic characters and digits
ascii
ASCII (7-bit) characters
binary
"0" and "1"
cntrl
control characters
digit
decimal digits
hdigit
hexadecimal digits (both cases)
ident
identifier characters
ident1
leading identifier characters
lower
lower cases letters
odigit
octal digits (0-7)
space
whitespace characters
upper
upper case letters
vowel
vowels (both cases)
Examples
See Also
string, StringTools, StringTools/Regular_Expressions
Download Help Document