常用的终端高亮规则

来自三线的随记

iterm profile: text high light settings

([^a-zA-Z0-9]|^)((?i)(failed)|(fail)|(error)|(timed out)|(time out)|(timeout)|(not found)|(can't))([^a-zA-Z0-9]|$)
  • iptables comment
\/\* .*? \*\/
  • iptables chain name
^Chain .*? (references|bytes)\)$
  • ip-address
([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})(/\d{1,2})?

TODO:

用于yum安装过程中的

No package | Packages skipped because of dependency problems | Skipped (dependency problems)

Xshell 突出高亮规则

  • 报文起始时间

正则表达式, 不区分大小写

(\d{2}:?){3}\.\d{6}
  • iptables chain

正则表达式, 区分大小写

^Chain .*? (references|bytes)\)$
  • iptables comments

正则表达式, 不区分大小写

\/\* .*? \*\/
  • mac地址

正则表达式, 不区分大小写

((\d|[a-z]){2}:){5}(\d|[a-z]){2}
  • timestamp

正则表达式, 不区分大小写

(^|\D)15\d{8}(\d{2})?
  • ipv4 address

正则表达式, 不区分大小写

([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})(/\d{1,2})?
  • error keyword

正则表达式, 不区分大小写

(\(|\s|\[|\")((failed)|(fail)|(error)|(timeout)|(timed out)|(timed out))(\"|\W|\]|\)|\s*?$)