![JAR search and dependency download from the Maven repository](/logo.png)
command-definition.grep.html Maven / Gradle / Ivy
The grep utility searches the input, selecting lines matching a pattern;
the types of patterns are controlled by the options specified.
By default, an input line is selected if any pattern, treated as an entire
regular expression matches any part of the line excluding the terminating
newline character(s). By default, each selected input line is written to the
output.
Regular expression matching is based on text lines. Since newline
character(s) separate or terminate patterns, regular expressions cannot
contain newline character(s). Similarly, since patterns are matched against
individual lines (excluding the terminating newline character(s)) of the
input, there is no way for a pattern to match newline character(s) found in
the input.
Regular expressions used in this command must be based on the
{@link java.util.regex.Pattern Java regular expression syntax}.