Prompt List
[x] How to catch date using ripgrep
[x] How to catch email using ripgrep
[x] How to catch time using ripgrep
[x] How to catch markdown titles using ripgrep
[x] How to catch hex color using ripgrep
[x] How to catch html tags using ripgrep
[ ] How to catch comments using ripgrep
[x] How to catch adresses using ripgrep
[ ] How to catch JSON geolocations using ripgrep
[x] How to catch Markdown titles using ripgrep
[x] How to catch Markdown tasks using ripgrep
[x] How to catch URL Links using ripgrep
[x] How to catch DNS Numbers using ripgrep
[x] How to catch SHA25 Hash Tokens using ripgrep
[ ] How to catch phone number using ripgrep
ripgrep Cheatsheet
Introduction
If you are using Neovim and ripgrep to navigate between files, this Cheatsheet will be a guide for you. Ripgrep is a very fast grep tool because it is written on Rust-regex.
When you use rg as the default command in your Telescope configurations on Neovim, you will see a huge speed difference in searches between your projects.
For more information, you can check the following links:
Official Page: Github – Ripgrep
Rust Regex Page: Rust Language – Regex
Catching Dates Using ripgrep
YYYY-MM-DD
(e.g., 2024-08-06):
DD/MM/YYYY or DD-MM-YYYY
(e.g., 06/08/2024 or 06-08-2024)
MM/DD/YYYY or MM-DD-YYYY
(e.g., 08/06/2024 or 08-06-2024):
Month DD, YYYY
(e.g., August 6, 2024)
Catching HTML Tags Using ripgrep
Basic HTML Tag Matching
Catching HTML tags
Advanced Matching (With Attributes)
Catching Tags with attributes
Catching Markdown Titles Using ripgrep
Markdown titles from level 1 to 6
h1, h2, h3, h4,h5, h6 titles
Markdown titles second level
h2 titles
Catching Markdown Tasks with ripgrep
Catching All Tasks
Catching markdown Tasks using ripgrep
Catching Incomplete Tasks
Catching incomplete markdown tasks using ripgrep
Catching Completed Tasks
Catching completed markdown tasks using ripgrep
URL Matching using ripgrep
Basic URL Matching
Basic URL matching
FTP URL Matching using ripgrep
FTP link Catching
Matching HTTPS Links using ripgrep
HTTPS catching with ripgrep
Matching URLs with Query Parameters and Fragments
Matching URLs with Query Parameters and Fragments
Matching URLs in Markdown Links
Matching URLs in Markdown files.
Alternative :
Matching HEX Codes Using ripgrep
3 Digit Hex Codes
e.g. #F00 – Red ( equivalent to #FF0000 )
6 Digit Hex Codes
#FF0000 – Red
#00FF00 – Green
#0000FF – Blue
8 Digit Hex Codes
** Colors with Alpha Channel **
#FF0000FF – Red with 100% opacity
#00FF00FF – Green with 100% opacity
#0000FFFF – Blue with 100% opacity
#FFFF00FF – Yellow with 100% opacity
#FF00FFFF – Magenta with 100% opacity
#00FFFFFF – Cyan with 100% opacity
** Colors with Transparency **
#FF000080 – Red with 50% opacity
#00FF0080 – Green with 50% opacity
#0000FF80 – Blue with 50% opacity
#FFFF0080 – Yellow with 50% opacity
#FF00FF80 – Magenta with 50% opacity
#00FFFF80 – Cyan with 50% opacity
** Shades of Gray with Alpha Channel **
#000000FF – Black with 100% opacity
#333333FF – Dark Gray with 100% opacity
#666666FF – Medium Gray with 100% opacity
#999999FF – Light Gray with 100% opacity
#FFFFFF00 – White with 0% opacity (fully transparent)
** Earth Tones with Alpha Channel **
#964B00FF – Brown with 100% opacity
#228B22FF – Forest Green with 100% opacity
#663300FF – Sienna with 100% opacity
#A0522DFF – Terra Cotta with 100% opacity
#808000FF – Olive Green with 100% opacity
All Format Hex codes
All formats of hex codes (3,6,8 digits )
Matching DNS Numbers using ripgrep
Matching IPv4 Adressses
** Private IP Addresses **
192.168.1.1 – Matches a private IP address (used for local networks)
10.0.0.1 – Matches a private IP address (used for local networks)
172.16.1.1 – Matches a private IP address (used for local networks)
** Public IP Addresses **
8.8.8.8 – Matches a public IP address (Google’s public DNS server)
216.58.194.174 – Matches a public IP address (Google’s public IP address)
157.240.195.35 – Matches a public IP address (Facebook’s public IP address)
** IP Addresses with Subnet Masks **
192.168.1.1/24 – Matches a private IP address with a subnet mask of 255.255.255.0
10.0.0.1/16 – Matches a private IP address with a subnet mask of 255.255.0.0
172.16.1.1/20 – Matches a private IP address with a subnet mask of 255.255.240.0
** IP Addresses with Default Gateways **
192.168.1.1/24 gw 192.168.1.254 – Matches a private IP address with a subnet mask of 255.255.255.0 and a default gateway of 192.168.1.254
10.0.0.1/16 gw 10.0.0.1 – Matches a private IP address with a subnet mask of 255.255.0.0 and a default gateway of 10.0.0.1
172.16.1.1/20 gw 172.16.1.1 – Matches a private IP address with a subnet mask of 255.255.240.0 and a default gateway of 172.16.1.1
Matching IPv6 Adressses
** Global Unicast Addresses **
2001:0db8:85a3:0000:0000:8a2e:0370:7334 – A global unicast address
2001:0db8:0000:0000:0000:0000:0000:0001 – A global unicast address
2001:4860:4860:0000:0000:0000:0000:8888 – A global unicast address (Google’s public IPv6 DNS server)
** Link-Local Addresses **
fe80:0000:0000:0000:0202:b3ff:fe1e:8329 – A link-local address
fe80:0000:0000:0000:0000:0000:0000:0001 – A link-local address
fe80::0202:b3ff:fe1e:8329 – A link-local address (abbreviated form)
** Unique Local Addresses **
fc00:0000:0000:0000:0000:0000:0000:0001 – A unique local address
fd00:0000:0000:0000:0202:b3ff:fe1e:8329 – A unique local address
fc00::1 – A unique local address (abbreviated form)
** Multicast Addresses **
ff02:0000:0000:0000:0000:0000:0000:0001 – A multicast address
ff15:0000:0000:0000:0000:0000:0000:0001 – A multicast address
ff02::1 – A multicast address (abbreviated form)
** Special Addresses **
::1 – The IPv6 loopback address
:: – The IPv6 unspecified address
ff00:0000:0000:0000:0000:0000:0000:0000 – The IPv6 multicast address range
Matching Email Using ripgrep
Matching Email Adresses using ripgrep
Matching Time using ripgrep
Catching times in the format HH:MM:SS
Catching times in the format HH:MM:SS
Catching times in the format HH:MM AM/PM
Catching times in the format HH:MM AM/PM
Matching Adressses using ripgrep
Matching Adressses using ripgrep
Catching JSON geolocations
Catching JSON geolocations
{“lat”: 37.7749, “lng”: -122.4194} format JSON geolocations
Catching JSON geolocations with additional properties
lat, lng, alt, accuracy propercies in JSON geolocations
SHA256 Matching Using ripgrep
Input: hello world
SHA-256 Hash: 315f5bdb76d078c43b8ac0064e4a0164612b1fce77c869345bfc94c75894edd3
Matching Phone Number using ripgrep
Catching phone numbers in the format (123) 456-7890
Catching phone numbers in the format (123) 456-7890