[英]What's the difference between [:space:] and [:blank:]?
[:blank:]匹配空格或制表符。
[:space:]匹配空白字符(空格和水平制表符)。
對我來說,兩個定義是相同的,我想知道它們是否真的重復?
如果它們不同,有什么區別?
對於GNU工具, grep.info
的以下grep.info
適用:
[:blank:]
Blank characters: space and tab.
[:space:]
Space characters: in the 'C' locale, this is tab, newline,
vertical tab, form feed, carriage return, and space.
您可以使用此命令找到該部分:
info grep 'Regular Expressions' 'Character Classes and Bracket Expressions'
這里可以更好地解釋它們各自匹配的內容
最大的區別是[:space:]
也會匹配新行字符等項目
空間意味着按下空格鍵和標簽
白色空間意味着它帶有換行符,標簽,換頁和回車以及所有空間。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.