Ad Widget

Collapse

Regex only want the first match.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aink99
    Junior Member
    • Mar 2021
    • 1

    #1

    Regex only want the first match.

    Hi Would like to know if it's possible to get only the first match for this regex
    ^ \(SQL\)Max Duration..* ([0-9]+[0-9])( \([0-9][0-9][0-9][0-9])


    I was able to isolate the value in second group but I am only interested to get the first match.

    (SQL)Max Duration.. 1132 (2021-02-21 07:17:46:095)
    (SQL)Std. Dev...... 3.36
    (SQL)Max Duration.. 13 (2021-02-21 07:05:43:582)

    I am able to achieve what I want with the /m option but look like it does not work in Zabbix.


    /^ \(SQL\)Max Duration..* ([0-9]+[0-9])( \([0-9][0-9][0-9][0-9])/m

Working...