限定通配符和非限定通配符_什么是通配符?

限定通配符和非限定通配符

限定通配符和非限定通配符

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.

通配符通常充当星号字符。 通配符通常用于编程,脚本编制和IT中,以表达不同情况的特殊含义。

通配符或通配符或通配符 (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.

好吧,字符实际上并不重要,但功能对于通配符更为重要。 所以不同的话是没有问题的,并用于Wild CharacterWildcard CharacterWildcard

通配符 (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.

甚至星号也被普遍接受为通配符,还有其他一些字符可以用作通配符。 ? * – _ []。 %被称为通配符,因为它们表示一个或多个字符。 MS-DOS,Windows命令行,MS Word,MS Excel,Linux Bash,Linux Terminal,SQL数据库查询语言,HTTP和URL使用通配符。

? 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.

?Question Mark是最受欢迎的通配符之一。 问号用于表示单个字符。 问号通常用在MS-DOS,MS Word,Linux Bash中。 例如“ poftu?” 可以匹配“ poftut”,“ poftun”,“ poftua”,……以及其他最后一个字符可以是字母的字符。 多个问号将表示多个字符。 例如“ poft ??” 或“ pof?u?” 可以在问号与字母的字符不同的地方使用。

* 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.

*Asterisk可用于表示非,单个或多个字符。 星号是最流行的通配符之一,它可以表示无,单个或多个字母字符。 例如,“ poftu *”将与“ poftu”,“ poftut”或“ poftut.com”匹配,其中“ poftu”部分应出现在单词的开头。

LEARN MORE  How To Use Regex (Regular Expression) with Grep?
了解更多如何在Grep中使用正则表达式(正则表达式)?

[] 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].

[]brackets用于显式指定通配符。 例如,为了匹配从a到f的字母,请使用[af],或者我们可以将5到9的数字与[5-9]匹配。

MS-DOS或PowerShell通配符 (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.

Windows操作系统命令行MS-DOS或cmd.exe或PowerShell提供对通配符的支持。 我们可以用 ? *字符以表示单个或多个字符。 MS-DOS和PowerShell命令使用通配符来对给定的文本或数字模式进行数学运算。

> 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.

在以下示例中,我们将列出名称以“ s”结尾的所有文件夹或目录,无论其第一个字符的开头如何。

> 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.

我们还可以根据文件的扩展名对文件进行匹配。 我们将使用*.txt类的星号来数学扩展名为.txt的文本文件。

> dir *.txt

MS Word和Excel通配符 (MS Word and Excel Wildcard)

Linux Bash或控制台通配符(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.

Linux Bash Shell也支持通配符。 甚至bash都为通配符提供了广泛的支持,以使bash环境非常灵活和有用。 类似于Windows MS-DOS和PowerShell *和? 通常用于数学文件和文件夹的名称。

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

在以下示例中,我们将通过bash shell列出Linux上以*.txt扩展名结尾的文件。

$ ls -l *.txt

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

我们还可以列出以字母“ P”开头的文件和文件夹,如下所示。

$ ls -l P*

SQL和MS Access通配符 (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.

SQL或结构化查询语言用于从SQL数据库进行查询以及插入,返回或更新日期。 SQL通常在通配符流行的地方提供文本和数字数据。 与其他通配符实现相比,SQL提供了更多的通配符。

LEARN MORE  Linux egrep Command Tutorial with Examples
了解更多带有示例Linux egrep命令教程

MS Access通配符(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”.

*表示零个或多个字符,与MS-DOS和Linux bash用法相同。 “ poftu *”将与“ poftup”,“ poftuy”,“ poftut”甚至“ poftu”和“ 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”.

? 或问号表示单个字符,类似于MS-DOS和Linux bash的用法。 “波夫图?” 将匹配“ poftup”,“ poftuy”,“ poftut”,但不匹配“ 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”.

[]或用于匹配给定字符或字符范围的括号。 “ po [fp] tut”将匹配“ poftut”,“ poptut”,但不匹配“ pottut”或“ potut”。

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

! 当前不匹配操作,其中给定字符将不匹配。 “ poft [!a] t”将与“ poftut”匹配,“ poftot” bu与“ 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”.

-或破折号代表一定范围的字符,通常是字母或数字范围。 “ poftut [0-4]”将匹配“ poftut0”,“ poftut1”,但不匹配“ poftut5”或“ poftut6”。

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

#表示单个数字字符。 “ poftut#”将匹配“ poftut1”,“ poftut5”,“ poftut9”,但不匹配“ poftutt”或“ poftut”。

SQL Server通配符 (SQL Server Wildcard Characters)

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

%或百分比表示零个或多个字符。 “ poftu%”将与“ poftup”,“ poftuy”,“ poftut”甚至“ poftu”和“ 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”.

_表示单个字符,类似于MS-DOS和Linux bash的用法。 “ poftu_”将匹配“ poftup”,“ poftuy”,“ poftut”,但不匹配“ 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”.

[]或用于匹配给定字符或字符范围的括号。 “ po [fp] tut”将匹配“ poftut”,“ poptut”,但不匹配“ pottut”或“ potut”。

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

^ present not match操作,其中给定字符将不匹配。 “ poft [^ a] t”将与“ poftut”匹配,“ poftot” bu与“ 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”.

-或破折号代表一个字符范围,通常是一个字母或数字范围。 “ poftut [0-4]”将匹配“ poftut0”,“ poftut1”,但不匹配“ poftut5”或“ poftut6”。

翻译自: https://www.poftut.com/what-is-wildcard-characters/

限定通配符和非限定通配符

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值