Particular line match using regex

前端 未结 4 1021
挽巷
挽巷 2021-01-28 01:09
This script may take a while to run, especially on a busy podmaster.
Generating Syslog TopN list on node for last 3 hours.

        Top 5 hosts for Day: Oct8 between 02:         


        
4条回答
  •  梦如初夏
    2021-01-28 01:33

    Change your regex to the below if the input contains the exact string you posted.

    (?s)\s+1+\s+([\d]+).*?\s+1+\s+([\d]+).*?\s+1+\s+([\d]+)
    

    DEMO

    For javascript,

    \s+1+\s+([\d]+)[\S\s]*?\s+1+\s+([\d]+)[\S\s]*?\s+1+\s+([\d]+)
    

    DEMO

提交回复
热议问题