# Wildcard

**URL:** <https://speciforum.org/t/wildcard/2230>\
**Category:** Get Help\
**Created:** [January 3, 2025, 3:06am UTC](https://speciforum.org/t/wildcard/2230 "2025-01-03T03:06:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kitchenprinzessin](https://avatars.discourse-cdn.com/v4/letter/k/9fc29f/32.png) [@kitchenprinzessin](https://speciforum.org/u/kitchenprinzessin)\
**Post date:** [January 3, 2025, 3:06am UTC](https://speciforum.org/t/wildcard/2230/1 "2025-01-03T03:06:48Z")

</div>

Happy New Year All!  
What is the difference between the wildcards asterisk (\*) and per cent (%) when searching records?

---

<div class="post-metadata">

**Author:** ![Grant](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/grant/32/4255_2.png) [@Grant](https://speciforum.org/u/Grant)\
**Post date:** [January 3, 2025, 4:11pm UTC](https://speciforum.org/t/wildcard/2230/2 "2025-01-03T16:11:10Z")

</div>

Hi @kitchenprinzessin,

Happy New Year to you as well!

Specify supports 3 primary wild card characters when using [Simple Search](https://speciforum.org/t/simple-search/185), the ‘Like’ operator in the Query Builder, and when searching from a query combo box form. The operators behave in the following ways:

| Wildcard | Represents | Placement Restrictions | Example Usage | Matches Examples |
| --- | --- | --- | --- | --- |
| `*` | Zero or more characters | Can be used at the **start** and **end** of a search string, but **not** between characters. | `*123*`, `123*` | **`*123*`** matches “Field123”, “Data123Field”, “123Data”; **`123*`** matches “123Data”, “123”; but **not** “A123B”. |
| `%` | Zero or more characters | Can be used **anywhere** in the string. | `%123`, `123%`, `A%BC`, `A%B%` | **`%123`** matches “Data123”, “123”; **`123%`** matches “123Data”, “123”; **`A%BC`** matches “A123BC”, “ABCD”; **`A%B%`** matches “AB”, “A1B”, “A123B234”. |
| `_` | A single character | Can be used **anywhere** in the string. | `h __t`, `sp____ y` | **`h __t`** matches “heat”, “host”; **`sp____ y`** matches “specify”, “spindly”, where underscores represent any single character. |

### Breakdown:

- **`%` (Percent Sign)** (Most Flexible): This wildcard offers the most flexibility as it can be used anywhere in the search string. It allows for complex pattern matching and can be repeated multiple times within a single query.

- **`*` (Asterisk)**: This wildcard is useful for searching for substrings that may appear at the beginning or end of a string. You can use two asterisks, one at the start and one at the end, but you cannot place an asterisk between characters, which _limits its flexibility_ compared to the other wildcards. If used within a search string, it will be interpreted literally.

- **`_` (Underscore)**: This wildcard is used to represent a single character. It can be placed anywhere in the string, allowing you to search for patterns where only one character is unknown.

---

<div class="post-metadata">

**Author:** ![kitchenprinzessin](https://avatars.discourse-cdn.com/v4/letter/k/9fc29f/32.png) [@kitchenprinzessin](https://speciforum.org/u/kitchenprinzessin)\
**Post date:** [January 5, 2025, 5:30am UTC](https://speciforum.org/t/wildcard/2230/3 "2025-01-05T05:30:24Z")

</div>

The comparison is well described. thanks you @Grant  
I also noticed that an asterisk is not supported in the query builder, but % and \_. is this correct?

---

<div class="post-metadata">

**Author:** ![bronwyn](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/bronwyn/32/5742_2.png) [@bronwyn](https://speciforum.org/u/bronwyn)\
**Post date:** [January 27, 2025, 5:24pm UTC](https://speciforum.org/t/wildcard/2230/4 "2025-01-27T17:24:10Z")

</div>

Hi @kitchenprinzessin,

Yes, it is true that the Specify 7 Query Builder supports `%` and `_` wildcards when using the ‘Like’ operator, but not `*`. The same is true when searching with a query combo box field.

However, [Simple Search](https://speciforum.org/t/simple-search/185) does allow for the asterisk wildcard to be used!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex029/uploads/specifysoftware/original/2X/1/18a843c97bc32b40e8ad0e035755bc88ffaacaf7.svg) [@system](https://speciforum.org/u/system)\
**Post date:** [February 3, 2025, 5:24pm UTC](https://speciforum.org/t/wildcard/2230/5 "2025-02-03T17:24:52Z")

</div>

Closed on February 3, 2025, 5:24pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
