Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-21856

trigger / calculated expression regexp dot escape possible regression

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Duplicate
    • Icon: Trivial Trivial
    • None
    • 6.2.4
    • Server (S)
    • None
    • S2401

      Hello,

      I believe there is a regression with the regular expression syntax with something that I think used to work on 5.4 and no longer does on 6.4 when specifying the regular expression that matches the literal . (dot) character.

      As per regular expression traditional syntax, the . should be escaped with a \ backslash (otherwise it matches any character). But it doesn't seem to work. (A work around is to use [.], but well, the backslash syntax is still a regression)

       

      Steps to reproduce

      create a calculated item with one of the four different formulas:

      count(//agent.ping,#10,"regexp", "[.]")
      

      returns 0, as expected

      count(//agent.version,#10,"regexp", "[.]")
      

      returns 10, as expected

      count(//agent.version,#10,"regexp", "\\.")
      

      returns 0 <- this is not expected, it should be 10, such as previous test

      count(//agent.version,#10,"regexp", "\.")
      

      rejected by frontend,  which is expected behavior as per double escape rule

       

      two formulas rightfully work

      one formula is rightly rejected

      one formula produces the unexpected result

       

       

            asitals Andrejs Sitals (Inactive)
            rumo Marc Rumo
            Team A
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: