Zabbix Documentation 3.4

3.04.04.45.0 (current)| In development:5.2 (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/08 16:04]
natalja.cernohajeva Example matching inline modifier added
manual:regular_expressions [2019/04/25 07:48]
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
  
-{{:​manual:​regular_expressions:​regexp_expr_3.png?600|}}  ​+{{:​manual:​regular_expressions:​regexp_expr_3a.png}}   
 + 
 +Chosen //​Expression type//: %%"​Result is TRUE"​%%. Characters "​error"​ are matched.  
 + 
 +=== Another example with an inline regex modifier === 
 + 
 +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_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 ===