Regex Cheatsheet
Last updated
Last updated
To add any selection as a rule, you need to
highlight the selected text
right click and select LevelOps > Add selection to LevelOps Rule
If you want your selection to work as a simple string match, just click on "Escape special characters" in the pop-up.
This will ensure that the selected string will be match-ready
When you want to add stack traces or multi line matches as a triage rule, you need to ensure that you are not including any line numbers or log time stamps in your rule. Lets look at the lines below
When I want to create a rule, I do not want to include "Jul 08, 2020". So we will delete any time stamps from the selection
Now just append [\s\S]+ between the lines
Now, this is ready to run as a rule match for the stack trace
abc* matches a string that has ab followed by zero or more c
abc+ matches a string that has ab followed by one or more c
abc? matches a string that has ab followed by zero or one c
abc{2} matches a string that has ab followed by 2 c
abc{2,} matches a string that has ab followed by 2 or more c
abc{2,5} matches a string that has ab followed by 2 up to 5 c
a(bc)* matches a string that has a followed by zero or more copies of the sequence bc
a(bc){2,5} matches a string that has a followed by 2 up to 5 copies of the sequence bc
\d matches a single character that is a digit -> Try it!
\w matches a word character (alphanumeric character plus underscore) -> Try it!
\s matches a whitespace character (includes tabs and line breaks)
. matches any character
\D matches a single non-digit character