What Is Wildcard Character(s)? – POFTUT

What Is Wildcard Character(s)?


The wildcard character generally acts like an asterisk character. The wildcard is generally used in programming, scripting, IT in order to express special meanings for different cases.

Wild Character or Wildcard Character or Wildcard

Well, the character is actually not important but the function is more important for the wildcard. So different sayings are not a problem and used for the Wild Character or Wildcard Character or Wildcard.

Wildcard Characters

Even the asterisk is generally accepted as the Wildcard character there are other characters which can be used as wildcard. ? * – _ [ ] . % are known as wildcard characters because they express one or more characters. MS-DOS, Windows Command Line, MS Word, MS Excel, Linux Bash, Linux Terminal, SQL Database Query Language, HTTP, and URLs use wildcards.

? or Question Mark is one of the most popular wildcard characters. The question mark is used to express a single character. Question mark generally used in MS-DOS, MS Word, Linux Bash. As an example “poftu?” can match “poftut”, “poftun”, “poftua”, … and others where the last character can be a letter. Multiple question marks will express multiple characters. As an example “poft??” or “pof?u?” can be used where the question mark will get different characters from letters.

* or Asterisk can be used to express non, single, or multiple characters. Asterisk is one of the most popular wildcard characters where it can express none, single, or multiple alpha characters. As an example “poftu*” will match with “poftu”, “poftut” or “poftut.com” where the “poftu” part should exist at the start of the word.

LEARN MORE  Regex (Regular Expression) OR Logic Alternation Tutorial with Examples

[] or brackets are used to specify wildcard characters explicitly. As an example in order to match a letter from a to f letters use [a-f] or we can match numbers from 5 to 9 with [5-9].

MS-DOS or PowerShell Wildcard

MS-DOS or cmd.exe or PowerShell which is the Windows operating systems command line provides support for the wildcard characters. We can use ? * characters in order to express single or multiple characters. MS-DOS and PowerShell commands use wildcard characters in order to math given text or number pattern.

> dir Win*

In the following example we will list all folder or directories which names end with the “s” letter no matter of the start of first characters of.

> dir *s

We can also match files according to their extensions. We will use asterisk like *.txt in order to math files with “.txt” extension which are text files.

> dir *.txt

MS Word and Excel Wildcard

Linux Bash or Console Wildcard

Linux Bash shell also supports the wildcards. Even bash provides extensive support for the wildcard characters in order to make the bash environment very flexible and useful. Similar to the Windows MS-DOS and PowerShell * and ? are heavily used to math files and folder’s names.

In the following example we will list files ending with *.txt extension on a Linux via bash shell.

$ ls -l *.txt

Also we can list files and folders those starts with the letter “P” like below.

$ ls -l P*

SQL and MS Access Wildcard

SQL or Structured Query Language is used to make querries and insert, return or update date from SQL databases. SQL generally provides textual and numeric data where wildcards are popular. SQL provides more wildcard characters then other wildcard implementations.

LEARN MORE  Compare Vi vs Vim

MS Access Wildcard Characters

* represents zero or more characters which is the same with MS-DOS and Linux bash usage. “poftu*” will match “poftup”, “poftuy”, “poftut” or even “poftu” and “poftututut”.

? or question mark represents single character which is similar to the MS-DOS and Linux bash usage. “poftu?” will match “poftup”, “poftuy”, “poftut” but not match “poftu”, “poftutut”.

[] or brackets used to match given characters or character range. “po[fp]tut” will match “poftut”, poptut” but not match “pottut” or “potut”.

! present not match operation where given characters will not matched. “poft[!a]t” will match “poftut”, “poftot” bu not match “poftat”.

- or dash represents a range of characters which are generally a letter or number range. “poftut[0-4]” will match “poftut0”, “poftut1” but not match “poftut5” or “poftut6”.

# represents single numeric character. “poftut#” will match “poftut1”, “poftut5”, “poftut9” but not match “poftutt” or “poftut”.

SQL Server Wildcard Characters

% or percentage represents zero or more characters. “poftu%” will match “poftup”, “poftuy”, “poftut” or even “poftu” and “poftututut”.

_ represents single character which is similar to the MS-DOS and Linux bash usage. “poftu_” will match “poftup”, “poftuy”, “poftut” but not match “poftu”, “poftutut”.

[] or brackets used to match given characters or character range. “po[fp]tut” will match “poftut”, poptut” but not match “pottut” or “potut”.

^ present not match operation where given characters will not matched. “poft[^a]t” will match “poftut”, “poftot” bu not match “poftat”.

- or dash represents a range of characters which are generally a letter or number range. “poftut[0-4]” will match “poftut0”, “poftut1” but not match “poftut5” or “poftut6”.

Leave a Comment