[:space:]和[:blank:]有什么区别? [英] What's the difference between [:space:] and [:blank:]?
本文介绍了[:space:]和[:blank:]有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
来自正则表达式简介
[:blank:]匹配空格或制表符.
[:blank:] matches a space or a tab.
[:space:]匹配空白字符(空格和水平制表符).
[:space:] matches whitespace characters (space and horizontal tab).
对我来说,两个定义是相同的,我想知道它们是否真的重复吗?
To me both definitions are the same and I was wondering if they are really duplicates?
如果它们不同,有什么区别?
If they are different, what are the differences?
推荐答案
对于GNU工具,grep.info
中的以下内容适用:
For the GNU tools the following from grep.info
applies:
[: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.
您可以使用以下命令找到该部分:
You can find the section with this command:
info grep 'Regular Expressions' 'Character Classes and Bracket Expressions'
这篇关于[:space:]和[:blank:]有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文