QuestionQ42

VerifiedIncident Detection and Triage

The SOC team at CyberSecure Corp is performing a security review to identify anomalous entries in firewall logs. The team must extract specific patterns, including email addresses, IP addresses, and URLs, to detect unauthorized access attempts, phishing activities, and suspicious external communications. The SOC analyst applies various regular-expression (regex) patterns to filter and analyze logs efficiently. For example, they use \b\d{l,3}.\d{l,3}.\d{l,3}.\d{l,3}\b to match IPv4 addresses.

Which regex pattern should the SOC analyst use to extract all hexadecimal color codes found in the logs?

Explanation

Hexadecimal color values are written with a leading # followed by either three or six hexadecimal characters. The character class [A-Fa-f0-9] permits all valid hexadecimal digits, and the alternation matches both shorthand and full color-code forms.

Community Discussion

No comments yet. Be the first to start the discussion!