Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
StringTools[WildcardMatch] - match strings against glob-style patterns
Calling Sequence
WildcardMatch( pattern, text )
Parameters
pattern
-
Maple string
text
Description
The WildcardMatch(pattern, text) command provides glob-style pattern matching. Given a pattern containing wildcards, and an input string text, WildcardMatch returns the value true if the given text matches the pattern, and returns the value false otherwise.
The wildcards are similar to those used in filename globbing in UNIX shells. These are defined as follows.
*
matches zero or more characters
?
matches one character
[ccl]
matches any character in the character class
ccl
Character classes denote sets of characters to match. A character class is enclosed in square brackets (). It can be a simple list of characters, such as , which matches any of the characters , , , or . Character classes can include character ranges, which are defined by their order in the US-ASCII character encoding. For example, the character class matches any lowercase letter, and matches any digit. A character class can be negated (or complemented) by including the character as the first within the character class. Thus, for instance, denotes the set of characters other than the digits. The "^" character has this special complementing meaning only when it appears as the first character in a character class. If it appears elsewhere, then it stands for itself. To include a hyphen character "-" in a character class, write it as the first character in the character class, or include it in a character range. To include the character "]" in a character class, write it as the first character following the opening bracket, or include it in a character range.
Pattern matching facilities provided by the StringTools package include regular expression matching (see StringTools[RegMatch]) and fast string search (see StringTools[Search] and searchtext).
Examples
Escape the opening square bracket ([) in the pattern using two backslashes to interpret it as a normal character.
See Also
searchtext, string, StringTools, StringTools[RegMatch], StringTools[Search]
Download Help Document