[...]
Matches any one of the enclosed characters. A pair of characters separated by a hyphen denotes a range Expression; any character that sorts between those two characters,inclusive,using the current locale’s collating sequence and character set,is matched. If the first character following the‘[’
is a‘!’
or a‘^’
then any character not enclosed is matched. A‘−’
may be matched by including it as the first or last character in the set. A‘]’
may be matched by including it as the first character in the set. The sorting order of characters in range Expressions is determined by the current locale and the value of theLC_ColLATE
shell variable,if set.For example,in the default C locale,
‘[a-dx-z]’
is equivalent to ‘[abcdxyz]’. Many locales sort characters in dictionary order,and in these locales‘[a-dx-z]’
is typically not equivalent to‘[abcdxyz]’
; it might be equivalent to‘[aBbCcDdxXyYz]’
,for example. To obtain the Traditional interpretation of ranges in bracket Expressions,you can force the use of the C locale by setting theLC_ColLATE
orLC_ALL
environment variable to the value‘C’
.Within
‘[’
and‘]’
,character classes can be specifIEd using the Syntax[:class:]
,where class is one of the following classes defined in the posix standard:
alnum Alpha ascii blank cntrl digit graph lower print punct space upper word xdigit
A character class matches any character belonging to that class. The word character class matches letters,digits,and the character
‘_’
.Within
‘[’
and‘]’
,an equivalence class can be specifIEd using the Syntax[=c=]
,which matches all characters with the same collation weight (as defined by the current locale) as the character c.Within
‘[’
and‘]’
,the Syntax[.symbol.]
matches the collating symbol symbol.
(重点添加到最常见的使用模式)
总结以上是内存溢出为你收集整理的linux – bash脚本中的[…]代表什么?全部内容,希望文章能够帮你解决linux – bash脚本中的[…]代表什么?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)