or example, the following command will change the match color to magenta and the background color for line numbers to yellow: .sp .EX rg \-\-colors 'match:fg:magenta' \-\-colors 'line:bg:yellow' .EE .sp Extended colors can be used for \fIvalue\fP when the tty supports ANSI color sequences. These are specified as either \fIx\fP (256-color) or .IB x , x , x (24-bit truecolor) where \fIx\fP is a number between \fB0\fP and \fB255\fP inclusive. \fIx\fP may be given as a normal decimal number or a hexadecimal number, which is prefixed by \fB0x\fP. .sp For example, the following command will change the match background color to that represented by the rgb value (0,128,255): .sp .EX rg \-\-colors 'match:bg:0,128,255' .EE .sp or, equivalently, .sp .EX rg \-\-colors 'match:bg:0x0,0x80,0xFF' .EE .sp Note that the \fBintense\fP and \fBnointense\fP styles will have no effect when used alongside these extended color codes. columnno-columnShow column numbers. Show column numbers (1-based). This only shows the column numbers for the first match on each line. This does not try to account for Unicode. One byte is equal to one column. This implies \flag{line-number}. .sp When \flag{only-matching} is used, then the column numbers written correspond to the start of each match. contextShow NUM lines before and after each match. Show \fINUM\fP lines before and after each match. This is equivalent to providing both the \flag{before-context} and \flag{after-context} flags with the same value. .sp This overrides the \flag{passthru} flag. The \flag{after-context} and \flag{before-context} flags both partially override this flag, regardless of the order. For example, \fB\-A2 \-C1\fP is equivalent to \fB\-A2 \-B1\fP. context-separatorno-context-separatorSEPARATORSet the separator for contextual chunks. The string used to separate non-contiguous context lines in the output. This is only used when one of the context flags is used (that is, \flag{after-context}, \flag{before-context} or \flag{context}). Escape sequences like \fB\\x7F\fP or \fB\\t\fP may be used. The default value is \fB\-\-\fP. .sp When the context separator is set to an empty string, then a line break is still inserted. To completely disable context separators, use the \flag-negate{context-separator} flag. countShow count of matching lines for each file. This flag suppresses normal output and shows the number of lines that match the given patterns for each file searched. Each file containing a match has its path and count printed on each line. Note that unless \flag{multiline} is enabled, this reports the number of lines that match and not the total number of matches. In multiline mode, \flag{count} is equivalent to \flag{count-matches}. .sp If only one file is given to ripgrep, then only the count is printed if there is a match. The \flag{with-filename} flag can be used to force printing the file path in this case. If you need a count to be printed regardless of whether there is a match, then use \flag{include-zero}. .sp This overrides the \flag{count-matches} flag. Note that when \flag{count} is combined with \flag{only-matching}, then ripgrep behaves as if \flag{count-matches} was given. count-matchesShow count of every match for each file. This flag suppresses normal output and shows the number of individual matches of the given patterns for each file searched. Each file containing matches has its path and match count printed on each line. Note that this reports the total number of individual matches and not the number of lines that match. .sp If only one file is given to ripgrep, then only the count is printed if there is a match. The \flag{with-filename} flag can be used to force printing the file path in this case. .sp This overrides the \flag{count} flag. Note that when \flag{count} is combined with \flag{only-matching}, then ripgrep behaves as if \flag{count-matches} was given. crlfno-crlfUse CRLF line terminators (nice for Windows). When enabled, ripgrep will treat CRLF (\fB\\r\\n\fP) as a line terminator instead of just \fB\\n\fP. .sp Principally, this permits the line anchor assertions \fB^\fP and \fB$\fP in regex patterns to treat CRLF, CR or LF as line terminators instead of just LF. Note that they will never match between a CR and a LF. CRLF is treated as one single line terminator. .sp When using the default regex engine, CRLF support can also be enabled inside the pattern with the \fBR\fP flag. For example, \fB(?R:$)\fP will match just before either CR or LF, but never between CR and LF. .sp This flag overrides \flag{null-data}. debugShow debug messages. Show debug messages. Please use this when filing a bug report. .sp The \flag{debug} flag is generally useful for figuring out why ripgrep skipped searching a particular file. The debug messages should mention all files skipped and why they were skipped. .sp To get even more debug output, use the \flag{trace} flag, which implies \flag{debug} along with additional trace data. dfa-size-limitNUM+SUFFIX?The upper size limit of the regex DFA. The upper size limit of the regex DFA. The default limit is something generous for any single pattern or for many smallish patterns. This should only be changed on very large regex inputs where the (slower) fallback regex engine may otherwise be used if the limit is reached. .sp The input format accepts suffixes of \fBK\fP, \fBM\fP or \fBG\fP which correspond to kilobytes, megabytes and gigabytes, respectively. If no suffix is provided the input is treated as bytes. encodingno-encodingENCODINGSpecify the text encoding of files to search. Specify the text encoding that ripgrep will use on all files searched. The default value is \fBauto\fP, which will cause ripgrep to do a best effort automatic detection of encoding on a per-file basis. Automatic detection in this case only applies to files that begin with a UTF-8 or UTF-16 byte-order mark (BOM). No other automatic detection is performed. One can also specify \fBnone\fP which will then completely disable BOM sniffing and always result in searching the raw bytes, including a BOM if it's present, regardless of its encoding. .sp Other supported values can be found in the list of labels here: \fIhttps://encoding.spec.whatwg.org/#concept-encoding-get\fP. .sp For more details on encoding and how ripgrep deals with it, see \fBGUIDE.md\fP. .sp The encoding detection that ripgrep uses can be reverted to its automatic mode via the \flag-negate{encoding} flag. engineENGINESpecify which regex engine to use. Specify which regular expression engine to use. When you choose a regex engine, it applies that choice for every regex provided to ripgrep (e.g., via multiple \flag{regexp} or \flag{file} flags). .sp Accepted values are \fBdefault\fP, \fBpcre2\fP, or \fBauto\fP. .sp The default value is \fBdefault\fP, which is usually the fastest and should be good for most use cases. The \fBpcre2\fP engine is generally useful when you want to use features such as look-around or backreferences. \fBauto\fP will dynamically choose between supported regex engines depending on the features used in a pattern on a best effort basis. .sp Note that the \fBpcre2\fP engine is an optional ripgrep feature. If PCRE2 wasn't included in your build of ripgrep, then using this flag will result in ripgrep printing an error message and exiting. .sp This overrides previous uses of the \flag{pcre2} and \flag{auto-hybrid-regex} flags. defaultpcre2