glob和regex

1. Regular expressions
      
Note that wildcard patterns are not regular expressions, although they are a bit similar.  First of all, they match  filenames, rather than text, and secondly, the conventions are not the same: for example, in a regular expression '*' means zero or more copies of the preceding thing.

       Now that regular expressions have bracket expressions where the negation is indicated by  a  '^',  POSIX  has declared the effect of a wildcard pattern "[^...]" to be undefined.

     译:glob中的通配符模式是用来处理文件名的,而regex是用来处理文本的,其次它们对元字符的解释是不一样的,例如:"*"在正则表达式中是表示匹配0次或者0次以上的意思,而glob中的意思是任意字符。

     正则表达式中中括号表达式取反使用"^",但是在glob中这种形式并没有被定义。



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值