!!Unix / Linux search command utility
!Usage:
{{{
grep [options] regexp [file...]
Options:
-v show lines that don't match instead of lines that match
-H print file names
-i ignore case
-E enable extended regular expressions
}}}
!Regular expressions:
Matching characters
{{{
. match any character
^ matches beginning of line
$ matches end of line
[abc] matches 'a', 'b', or 'c'
[^abc] matches anything except 'a', 'b', or 'c'
[a-e] range match, same as [abcde]
[[:x:]] match pre-difned class of characters as follows:
:alnum:
:alpha:
:digit:
:lower:
:upper:
:space:
\w same as [[:alnum:]]
\W same as [^[:alnum:]]
}}}
Repeating characters
{{{
? preceding item matched 0 or 1 time
* zero or more times
+ one or more times
}}}