Regex Cheat Sheet: Anchors Special Characters
Regex Cheat Sheet: Anchors Special Characters
http://networkdefense.io - http://regextraining.com
Common DFIR RegEx
Common Hash Formats
MD5 [a-fA-F0-9]{32} SHA256 [a-fA-F0-9]{64}
SHA1 [a-fA-F0-9]{40} SHA512 [a-fA-F0-9]{128}
IP Addresses
IPv4 (Simple) (?:\d{1,3}\.){3}\d{1,3}
IPv4 (Accurate) (?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-
9]|[01]?[0-9][0-9]?)
IPv6 (?:[a-fA-F0-9]{1,4}:){7}[a-fA-F0-9]{1,4}
MAC Address
MAC [0-9A-F]{2}([-:]?)(?:[0-9A-F]{2}\1){4}[0-9A-F]{2}
E-Mail
Address /^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/
URLs
Constituent parts of (?i)(?<URL>(?<scheme>https?)://(?<domain>[^/:]+(?<=\.(?<TL
HTTP/HTTPS URL - D>[^/:]+)))(?(?=:):(?<port>\d{1,5})|)(?(?=/)(?<URI>/[^/]+)+(?<f
Insensitive inline modifier ile>/[^.]+\.\S+)?))
Directory/File Path
Drive (?x)(?>\b[a-z]:|\\\\[a-z0-9 %._~-]{1,63}\\[a-z0-9 $%._~-]{1,80})\\
Folder (?>[^\\/:*?"<>|\x00-\x1F]{0,254}[^.\\/:*?"<>|\x00-\x1F]\\)*
File (?>[^\\/:*?"<>|\x00-\x1F]{0,254}[^.\\/:*?"<>|\x00-\x1F])?
Standard Path (?>\b[a-z]:|\\\\[a-z0-9 %._~-]{1,63}\\[a-z0-9 $%._~-
]{1,80})\\(?>[^\\/:*?"<>|\x00-\x1F]{0,254}[^.\\/:*?"<>|\x00-
\x1F]\\)*(?>[^\\/:*?"<>|\x00-\x1F]{0,254}[^.\\/:*?"<>|\x00-\x1F])?
Windows Path [a-z]:\\(?>[^\\/:*?"<>|\x00-\x1F]{0,254}[^.\\/:*?"<>|\x00-
\x1F]\\)*(?>[^\\/:*?"<>|\x00-\x1F]{0,254}[^.\\/:*?"<>|\x00-\x1F])?
http://networkdefense.io - http://regextraining.com