Function Entry: WCMATCH
← Prev | ↑ Chapter | Next → | Index | Symbols
Function Entry: WCMATCH
Name
wcmatch
Class
Function
Syntax
(wcmatch str pattern)
Arguments and Values
str: string to test. Comparison is case-sensitive.pattern: string containing wild-card pattern-match characters.
Description
Performs a wild-card pattern match. Only the first ~500 characters of both arguments are compared. The supported pattern syntax is:
| Pattern char | Matches |
|---|---|
# |
a single numeric digit |
@ |
a single alphabetic character |
. |
a single non-alphanumeric character |
* |
any character sequence, including empty |
? |
a single character |
~ |
negation (must be the first character of the pattern) |
[ … ] |
any one of the enclosed characters |
[~ … ] |
any character not in the enclosed set |
- |
character range, used inside [ ] |
, |
separates multiple pattern alternatives |
` `` |
escape: take the next character literally |
The , separator gives wcmatch an OR-of-patterns semantics: the result is T if any of the comma-separated patterns matches.
Return Values
Returns T when the pattern matches, otherwise nil.
Side Effects
None.
Examples
(wcmatch "Name" "N*")returns T.(wcmatch "Name" "???,~*m*,N*")returns T — three alternatives joined by,.
Availability
- AutoCAD 2026: documented.
- BricsCAD V26: presumed compatible.
- Status: AutoCAD documented; BricsCAD presumed-both pending Phase 4 verification.
Source Notes
- [wcmatch (AutoLISP 2026)](https://help.autodesk.com/cloudhelp/2026/ENU/AutoCAD-AutoLISP-Reference/files/GUID-EC257AF7-72D4-4B38-99B6-9B09952A53AD.htm)
- Status: documented (Phase 3 body fill).