0
鑑於以下文件grep的工作:忽略大小寫切換和尖不與預期
this is some words
and this one too<div>
<html></html>
and more words 123
Caps to begin
ASDFSDFSDF
以下兩個命令工作,我期望:
grep -i '[:alpha:]' testfile
給
this is some words
and this one too<div>
<html></html>
and more words 123
Caps to begin
ASDFSDFSDF
and
grep '[:alpha:]' testfile
給
this is some words
and this one too<div>
<html></html>
and more words 123
Caps to begin
但
grep '^[:alpha:]' testfile
and this one too<div>
and more words 123
和
grep -i '^[:alpha:]' testfile
and this one too<div>
and more words 123
ASDFSDFSDF
應確保線路開始以字母數字已經一切都搞砸了插入符號。爲什麼'這是一些字'的行和'帽開始'行不匹配? 這是在Mac Lion上使用bash。
是啊。我混淆了語法'[[:alpha:]]'和''[a-z]''。 Grep和疲倦混合不好 – Brynjar