Grep Regular Expression Cheat Sheet



Cheat sheet based off the Udemy cysa+ course from Jason Dion – video 75 as i’m sure i’ll end up looking for it at some point in the future.

REGEX:

[] – Match a single instance of a chracter from a range such as a-z A-Z 0-9 or for all [a-zA-Z0-9]

[s] – Match whitespace

Grep regex cheat sheet. Linux Tutorial - Grep Cheat Sheet, This cheat sheet is intended to be a quick reminder for the main concepts involved in using the command line program grep and assumes you already This cheat sheet is intended to be a quick reminder for the main concepts involved in using the command line program grep and assumes you already understand its usage. Similar to the sed cheat sheet I shared in the previous article here, this article will be an awk cheat sheet. All the examples illustrated here may not be entirely original as this is something I've compiled over the years while using awk. Without any further ado, here it goes.

[d] – Match a digit

+ – Match one or more occurrences e.g. d+-

*- Match zero or more occurrences e.g. d*

? – Match one or none occureences e.g. d?

{} – Match the number of times within the braces e.g. d{3} finds 3 digits in a row or d{7-10} matches 7,8,9 or 10 digits in a row

| – OR

Grep Regular Expression Cheat Sheet Free

^ – Only search at the start of a line

$ – Only search at the end of a line

Grep Regular Expression Cheat Sheet

GREP:

Grep Regular Expression Cheat Sheet

-F = search for a literal value, can use “” instead of -F

-r = recursive

Perl Regular Expression Cheat Sheet

-i = Ignore case sensitivity

-v = Find things which do not match

-w = Treat search strings as words (instead of parts of words)

-c = Show count of matches

Grep Regular Expression Cheat Sheet Excel

-l = Return names of files containing matches

-L = Return names of files without matches