Ravi Sir's Cards › AWS
Regex cheat card
This revision card explains Regex cheat card. It starts from the need that match patterns, not just words. It describes ^ start, $ end,. any, * repeat. The how-to section notes -E for + ? | {n} and groups. An example on the card is extract IPs only.
Read card text
What this card says
Why do we need it?
Match patterns, not just words.
What is it?
^ start, $ end, . any, * repeat.
How to do it
-E for + ? | {n} and groups.
Example
Extract IPs only.
grep -oE '[0-9]+(\.[0-9]+){3}' access.log