DELAPARRA
Index
Color
NL
Category: Regex flags

/I (Case-Insensitive (POSIX / grep))

Explained by Updated

What is /I (Case-Insensitive (POSIX / grep))?

/I (Case-Insensitive (POSIX / grep)): The command-line equivalent of the i flag for tools built on POSIX regex, not an inline pattern flag. In command-line tools that use POSIX regular expressions, case-insensitive matching is a command option rather than a flag inside the pattern. grep -i 'error' finds Error, ERROR and error. In some tools the option is spelled with a capital I, which is why you see this listed separately.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about /I (Case-Insensitive (POSIX / grep))

How is /I (Case-Insensitive (POSIX / grep)) used in practice?

The distinction matters when you move between tools. In JavaScript you write /error/i, in PHP /error/i, in Python re.I, and on the command line you add a switch to the command. The idea is the same; the place you put it differs.

What should you keep in mind with /I (Case-Insensitive (POSIX / grep))?

When you search logs, case-insensitive matching is usually what you want, because different parts of a system spell levels and messages differently. When you search code, matching case exactly avoids noise from unrelated variables that happen to share a word. grep -i and grep cover both.

At a glance

CategoryRegex flags
Explained by
Updated

More Regex flags terms

All terms starting with a number or symbol

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.