# (wcmatch string pattern)
[GstarCAD 2012](../../../Index.md) → [Developer Reference](../../%28Developer%20Reference%29.md) → [AutoLISP Reference](../%28AutoLISP%20Reference%29.md) → [LISP Functions](%28LISP%20Functions%29.md)
<a id="307"></a>
## (wcmatch string pattern)
---
Search that string.
---
This function finds internal string matches. You can see if a certain string is found, or match it with another string.
For example, if you had a string variable called MYVAR which contained the string "SUPERCALIFRAGILISTIC123\\##" and you wanted to see if the characters "FRAG" were anywhere in the string you could use the **wcmatch** function, as follows:
(**wcmatch** MYVAR "\*FRAG\*")
If a match is found, **wcmatch** returns T. If no match is found, nil is returned. The **wcmatch** function is case-sensitive. To find a match, you should use [strcase](%28strcase%20string%20-flag-%29.md) to change everything to uppercase if necessary.
You can use several wildcards for **wcmatch:**
| Wildcard | Definition |
| --- | --- |
| \~ | (tilde) Pattern not found in string. |
| \* | Standard wildcard; can be used anywhere. |
| ? | Matches for a space held by a character or number; number of question marks (?) must exactly match number of characters or numbers in the string. |
| \# | (pound) Matches any single number. |
| @@ | Matches any single character; may not be a number. |
| . | (period) Matches any single non-alphanumeric character. |
| | (space) Matches one or more spaces. |
| \[ \] | Matches for any of the characters enclosed in the brackets. |
| \[\~ \] | True only if there are extra characters not included in the brackets. |
| \[ \- \] | (hyphen) Searches within a predefined range pattern. |
| , | (comma) The "or" option. |
| ' | (reverse quote) Read next character literally; use for special characters. |
### Examples
| Code | Returns | Comments |
| --- | --- | --- |
| (setq N "11234 TROPICANA AVE.#@") | | |
| (**wcmatch** N "\~345") | T | "345" is not found in the pattern. |
| (**wcmatch** N "\*opic\*" ) | T | "opic" is found with anything before and after. |
| (**wcmatch** N "?????????????????????") | T | There are 21 characters, numbers and spaces in this string. |
| (**wmatch** N "#####\*") | T | Matches 5 digits, followed by anything. |
**Tell me about...**
[(setq symbol1 statement1 \[symbol2 statement2\] ...)](%28setq%20symbol1%20statement1%20-symbol2%20statement2-%20...%29.md)
[(substr string start \[length\])](%28substr%20string%20start%20-length-%29.md)
[LISP Compatibility](../LISP%20Compatibility.md)
[Programming Overview of LISP (LISt Processing) Language](../Programming%20Overview%20of%20LISP%20%28LISt%20Processing%29%20Language.md)
<a id="holding"></a>
## Other versions with matching text
[GstarCAD 2011](../../../../2011/Developer%20Reference/AutoLISP%20Reference/LISP%20Functions/%28wcmatch%20string%20pattern%29.md)