grep与预期的正则表达式模式不匹配

I'm using the built-in grep command to display the Table Of Content of my own bash cheatsheet.

Titles looks like this: [3.1] - REMOTE LOGIN TO A HOST OR INSTANCE

这是命令:

grep -E '\[[0-9][0-9]?\.?[0-9]?[0-9]?\] - [A-Z]+' $FILE | less

The pattern is supposed to match all my titles, as you can see here

但是,由于我忽略的原因,模式不匹配:

[2.10]
[2.11]
[2.12]

但匹配:

[2.1]
...
[2.9]
[2.13]
[2.14]

任何人 ?

评论