Zabbix Documentation 3.4

3.04.04.4 (current)| In development:5.0 (devel)| Unsupported:1.82.02.22.43.23.44.2Guidelines

User Tools

Site Tools


manual:regular_expressions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
manual:regular_expressions [2018/03/09 13:30]
natalja.cernohajeva
manual:regular_expressions [2019/04/25 07:48] (current)
martins-v it's possible to run out of stack when using regular expressions
Line 13: Line 13:
  
 You may manually enter a regular expression in supported places. Note that the expression may not start with @ because that symbol is used in Zabbix for referencing global regular expressions. You may manually enter a regular expression in supported places. Note that the expression may not start with @ because that symbol is used in Zabbix for referencing global regular expressions.
 +
 +<note warning>​It'​s possible to run out of stack when using regular expressions. See the [[http://​pcre.org/​original/​doc/​html/​pcrestack.html|pcrestack man page]] for more information.</​note>​
  
 === Global regular expressions === === Global regular expressions ===
Line 47: Line 49:
  
   ^TESTDATABASE$   ^TESTDATABASE$
- 
-Chosen //​Expression type//: "​Result is FALSE"​. Doesn'​t match name, containing string "//​TESTDATABASE//"​. 
  
 {{:​manual:​regular_expressions:​regexp_expr_2.png}} {{:​manual:​regular_expressions:​regexp_expr_2.png}}
  
 +Chosen //​Expression type//: %%"​Result is FALSE"​%%. Doesn'​t match name, containing string "//​TESTDATABASE//"​.
  
 === Example with an inline regex modifier === === Example with an inline regex modifier ===
  
-Use of the following regular expression to match the characters "​error":​+Use of the following regular expression ​including an inline modifier (?i) to match the characters "​error":​
  
   (?i)error   (?i)error
Line 61: Line 62:
 {{:​manual:​regular_expressions:​regexp_expr_3a.png}}  ​ {{:​manual:​regular_expressions:​regexp_expr_3a.png}}  ​
  
-Chosen //​Expression type//: "​Result is TRUE". Characters "​error"​ are matched. ​+Chosen //​Expression type//: ​%%"​Result is TRUE"%%. Characters "​error"​ are matched. ​
  
 === Another example with an inline regex modifier === === Another example with an inline regex modifier ===
  
-Use of the following regular expression to match the characters ​"​error"​:+Use of the following regular expression ​including multiple inline modifiers ​to match the characters ​after a specific line: 
 +  (?<​=match (?​i)everything(?​-i) after this line\n)(?​sx).*#​ we add s modifier to allow . match newline characters
  
-{{:​manual:​regular_expressions:​regexp_expr_4a.png}}+{{:​manual:​regular_expressions:​regexp_expr_4_new.png}}
  
 +Chosen Expression type: %%"​Result is TRUE"​%%. Characters after a specific line are matched. ​
  
 +<note important>​ **g** modifier can't be specified in line. The list of available modifiers can be found in [[https://​www.pcre.org/​original/​doc/​html/​pcresyntax.html#​SEC16|pcresyntax man page]]. For more information about PCRE syntax please refer to [[https://​www.pcre.org/​original/​doc/​html/​pcrepattern.html|PCRE HTML documentation]]. ​ </​note>​
  
 === More complex example === === More complex example ===