Posts

Showing posts from October, 2015

Regex - Find line that contain certain words

When you are using text editor, such as Notepad++, which support regular expression search, to analyze log file, below are some regular expression that could be useful

Basic
... | ...      Means boolean Or. Example, apple | pear match apple or pear

(...)         Means grouping. Example, gr(a|e)y match gray or grey

?             Means there is zero or one of the preceding element. Example, colo?ur match color or colour

*             Means there is zero or more of the preceding element. Example, ab*c match ac, abc, abbc, etc..

+             Means there is one or more of the preceding element. Example, ab+c match abc, abbc, etc

^             Means match starting position of the line. Example, ^abc match abcxyz but not xyzabc

$             Means match ending position of the line. Example, abc$ match xyzabc but not abcxyz

.              Means match any single character. Example, .at match cat, hat, lat, etc....

\b            Means word boundary. It is typically used to avoid accidentally …