OSSEC文档——正则语法

翻译:http://ossec-docs.readthedocs.io/en/latest/Syntax/regex.html

正则语法

目前,OSSEC支持正则表达式语法:
OS_Regex或正则表达式
OS_Match或sregex

OS_Regex或正则表达式

在c语言中,快速而简单的正则表达式库。

这个库的设计很简单,但是支持最常用的正则表达式。它在设计时考虑了入侵检测系统,
支持表达式:

\w  ->  A-Z,a-z,0-9,'-','@' 字符
			\d  ->  0-9 
			\s  ->  For spaces " "
			\t  ->  For tabs.
			\p  ->  ()*+,-.:;<=>?[]!"'#$%&|{} (标点符号)
			\W  ->  For anything not \w
			\D  ->  For anything not \d
			\S  ->  For anything not \s
			\.  ->  For anything
修饰符
+  ->  To match one or more times (eg \w+ or \d+)
			*  ->  To match zero or more times (eg \w* or \P*)
特殊字符
^ -> To specify the beginning of the text.
			$ -> To specify the end of the text.
			| -> To create an "OR" between multiple patterns.
转义字符
$ -> \$
			( -> \(
			) -> \)
			\ -> \\
			| -> \|

OS_Match或sregex
比osregex/regex更快,但是只支持简单的字符串匹配和以下特殊字符。
^ -> To specify the beginning of the text.
			$ -> To specify the end of the text.
			| -> To create an "OR" between multiple patterns.

相关文章

正则替换html代码中img标签的src值在开发富文本信息在移动端...
正则表达式
AWK是一种处理文本文件的语言,是一个强大的文件分析工具。它...
正则表达式是特殊的字符序列,利用事先定义好的特定字符以及...
Python界一名小学生,热心分享编程学习。
收集整理每周优质开发者内容,包括、、等方面。每周五定期发...