我想搜索包含事件「cmaeventd」,而不是數量「」事件。我正在使用RHEL。正則表達式:搜索包含「cmaeventd」,而不是數字「2424」
例如,如果我有以下線:
HP Appliance Hardware Error: Jun 20 22:41:30 pnn-a cmaeventd[2424]: Surface Analysis Pass Information, LDrv=0 Number of passes=34
HP Appliance Hardware Error: Jun 20 22:41:30 pnn-a cmaeventd[2624]: Surface Analysis Pass Information, LDrv=0 Number of passes=34
HP Appliance Hardware Error: Jun 20 22:41:30 pnn-a cmaeventd[2484]: Surface Analysis Pass Information, LDrv=0 Number of passes=34
正則表達式應該僅提取行:
HP Appliance Hardware Error: Jun 20 22:41:30 pnn-a cmaeventd[2624]: Surface Analysis Pass Information, LDrv=0 Number of passes=34
HP Appliance Hardware Error: Jun 20 22:41:30 pnn-a cmaeventd[2484]: Surface Analysis Pass Information, LDrv=0 Number of passes=34
,因爲事件號不同從2424
我不習慣正則表達式。我怎樣才能做到這一點?
沒有關於您正在使用正則表達式的系統的信息,您不太可能收到對您的方案正確和有用的答案。請查看['regex'標記wiki](http://stackoverflow.com/tags/regex/info)和[更新您的問題](http://stackoverflow.com/posts/31023189/edit),並提供相關詳細信息幫助我們幫助你。 – tripleee
我正在使用RHEL – Condor01