Page tree

SAYMON документация

Skip to end of metadata
Go to start of metadata

Event Log search supports regular expressions.

Regular expression is a special language using which it is possible to look for matches in text. Regular expressions allow to use more complicated filters than simple text match.

Items marked "+" should work in most regular expressions implementations.

Anchors

^Start of line +
\AStart of string +
$End of line +
\ZEnd of  string +
\bWord boundary +
\BNot word boundary +
\<Start of word
\>End of word

Character classes

\cControl character
\sWhite space
\SNot white space
\dDigit
\DNot digit
\wWord
\WNot word
\xhhHexadecimal character hh
\OxxxOctal character ххх

POSIX character classes

[:upper:]Upper case letters
[:lower:]Lower case letters
[:alpha:]All letters
[:alnum:]Digits and letters
[:digit:]Dogits
[:xdigit:]Hexadecimal digits
[:punct:]Punctuation
[:blank:]Space and tab
[:space:]Blank characters
[:cntrl:]Control characters
[:graph:]Printed characters
[:print:]Printed characters and spaces
[:word:]Digits, letters and underscore

Assertions

?=Lookahead assertion +
?!Negative lookahead +
?<=Lookbehind assertion +
?!= или ?Negative lookbehind +
?>Once-only Subexpression
?()Condition [if then]
?()|Condition [if then else]
?#Comment

Quantifiers

*0 or more +
*?

0 or more, ungreedy +

+1 or more +
+?1 or more, ungreedy +
?0 or 1 +
??0 or 1, ungreedy +
{3}Exactly 3 +
{3,}3 or more +
{3,5}3, 4 or 5 +
{3,5}?3, 4 or 5, ungreedy +

Special characters

\Escape character +
\nNew line +
\rCarriage return +
\tTab +
\vVertical tab +
\fForm feed +
\aAlarm
[\b]Backspace
\eEscape
\N{name}Named character

String replacement (Backreferences)

$nnth non-passive group
$2"xyz" in /^(abc(xyz))$/
$1"xyz" in /^(?:abc)(xyz)$/
$`Before matched string
$'After matched string
$+Last matched string
$&Entire matched string
$_Entire input string
$$Literal "$"

Ranges

.Any character except new line (\n) +
(a|b)a or b +
(...)Group +
(?:...)Passive group +
[abc]Range (a or b or c) +
[^abc]Not a or b и or c +
[a-q]Letter between a and q +
[A-Q]Upper case letter between A and Q +
[0-7]Digit between 0 and 7 +
\nnth group/subpattern +

Ranges are inclusive.

Pattern modifiers

gGlobal match
iCase-insensitive
mMultiple lines
sTreat string as single line
xAllow comments and white space in pattern
eEvaluate replacement
UUngreedy pattern

Metacharacters (must be escaped)

^[.${*(
\+|?<>)

Sample patterns

([A-Za-z0-9-]+)Letters, numbers and hyphens
(\d{1,2}\/\d{1,2}\/\d{4})Date, e.g. 21/3/2006
([^\s]+(?=\.(jpg|gif|png))\.\2jpg, gif or png image
(^[1-9]{1}$|^[1-4]{1}[0-9]{1}$|^50$)Any number from 1 to 50 inclusive
(#?([A-Fa-f0-9]){3}(([A-Fa-f0-9]){3})?)Valid hexadecimal color code
((?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,15})8 to 15 character string with at least one upper case letter, one lower case letter and one digit (useful for passwords)
(\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,6})Email addresses
(\<(/?[^\>]+)\>)HTML tags

These patterns are intended for reference purposes and have not been extensively tested. Please use with caution and test thoroughly before use.

  • No labels