Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Wildcard character

From Wikipedia, the free encyclopedia
(Redirected from *.*)

In software, a wildcard character is a kind of placeholder represented by a single character, such as an asterisk (*), which can be interpreted as a number of literal characters or an empty string. It is often used in file searches so the full name need not be typed.[1]

Telecommunication

[edit]

In telecommunications, a wildcard is a character that may be substituted for any of a defined subset of all possible characters.

Computing

[edit]

In computer (software) technology, a wildcard is a symbol used to replace or represent zero or more characters.[2] Algorithms for matching wildcards have been developed in a number of recursive and non-recursive varieties.[3]

File and directory patterns

[edit]

When specifying file names (or paths) in CP/M, Atari DOS, MS-DOS, Windows, and Unix-like operating systems, the asterisk character (*, also called "star") matches zero or more characters. For example, doc* matches doc and document but not dodo. If files are named with a date stamp, wildcards can be used to match date ranges, such as 202607*.mp4 to select video recordings from July 2026, to facilitate file operations such as copying and moving.

In Unix-like operating systems, MS-DOS, and Atari DOS, the question mark ? matches exactly one character. In MS-DOS, if the question mark is placed at the end of the word, it will also match missing (zero) trailing characters; for example, the pattern 123? will match 123 and 1234, but not 12345.

In Unix shells and Windows PowerShell, ranges of characters enclosed in square brackets ([ and ]) match a single character within the set; for example, [A-Za-z] matches any single uppercase or lowercase letter. In Unix shells, a leading exclamation mark ! negates the set and matches only a character not within the list. In shells that interpret ! as a history substitution, a leading caret ^ can be used instead.

The operation of matching of wildcard patterns to multiple file or path names is referred to as globbing.

Databases

[edit]

In SQL, wildcard characters can be used in LIKE expressions; the percent sign % matches zero or more characters, and underscore _ a single character. Transact-SQL also supports square brackets ([ and ]) to list sets and ranges of characters to match, a leading caret ^ negates the set and matches only a character not within the list. In Microsoft Access, the asterisk sign * matches zero or more characters, the question mark ? matches a single character, the number sign # matches a single digit (0–9), and square brackets can be used for sets or ranges of characters to match.

Regular expressions

[edit]

In regular expressions, the period (., also called "dot") is the wildcard pattern which matches any single character. Followed by the Kleene star operator, which is denoted as an asterisk (*), we obtain .*, which will match zero or more arbitrary characters.

Search engines

[edit]

The wildcard operator can be used in Google Search to fetch results which have one or more word(s) inserted between phrases; e.g. Googling "I love * so much" will populate results such as "I love this game so much," "I love my wife so much," etc.[4]

Namespaces

[edit]

In some languages, such as Java and Rust, an asterisk can be used to qualify all symbols inside a namespace (sometimes called a "glob import" or "wildcard import"). For example, in Java import java.util.*; adds into scope all public classes from the java.util package, while in Rust use std::collections::*; adds into scope all public symbols from the std::collections module.

Generic types

[edit]

In some languages, a type parameter may be a wildcard, which is used to control type safety of a type parameter in a generic type.

  • In Java, this is represented by the character ? (for example List<?>),[5]
  • In Kotlin, this is represented by the character * (for example List<*>).
  • In Scala, this is represented by the character ? since Scala 3 (for example List[?]); in Scala 2, the character _ was used to represent the type wildcard (for example List[_]).[6]

In Rust, a generic type parameter can be left unspecified for the compiler to interpret using _, called an "inferred type" (for example Vec<_>).[7]

See also

[edit]

References

[edit]
  1. "Using wildcard characters". Microsoft. Archived from the original on 2017-03-24. Retrieved 2018-01-23.
  2. "What is a wildcard?". Computer Hope. Archived from the original on 2016-11-21. Retrieved 2016-11-21.
  3. Cantatore, Alessandro (Apr 25, 2003). "Wildcard matching algorithms". Archived from the original on Oct 14, 2023.
  4. "Google's * Wildcard Operator - Google Guide". Retrieved 2025-06-19.
  5. "Chapter 4. Types, Values, and Variables". docs.oracle.com. Retrieved 2020-11-03.
  6. scala-lang.org (28 May 2026). "Wildcard Arguments in Types". docs.scala-lang.org. scala-lang.org.
  7. The Rust Devs (16 June 2026). "Inferred type". doc.rust-lang.org. The Rust Reference.
[edit]