Match regex from right to left?

后端 未结 6 451
心在旅途
心在旅途 2020-12-11 15:27

Is there any way of matching a regex from right to left? What Im looking for is a regex that gets

MODULE WAS INSERTED              EVENT
LOST SIGNAL ON E1/T         


        
6条回答
  •  再見小時候
    2020-12-11 15:43

    Can you do field-oriented processing, rather than a regex? In awk/sh, this would look like:

    < $datafile awk '{ print $(NF-3), $(NF-2) }' | column

    which seems rather cleaner than specifying a regex.

提交回复
热议问题