grep Pattern Builder

Command

The path is left unquoted so a glob like src/*.js still expands in your shell.

Learn

grep Pattern Builder Guide

About this tool

Put together a grep command with the right regex flavour and the flags that keep the output readable. Pick extended, basic, fixed or Perl patterns, choose recursion, case, line numbers, context and file filters, and the page builds the command with the pattern safely quoted.

Questions

When should I use -F?
When you are searching for literal text that contains regex characters, such as an IP address with dots or a string with brackets. -F treats the pattern as plain text, so nothing needs escaping.
What is the difference between -E and -P?
-E uses extended regular expressions for groups and alternation. -P requests Perl-compatible patterns such as lookarounds, but not every version of grep supports it. Test on the machine where you will run the command.
How do I pass several extensions?
The builder writes one --include for the exact text in the field and shell-quotes it. To use several patterns, add separate --include options to the copied command yourself; brace expansion inside the quoted field will not expand.