RESOURCE MONITOR
CPU23%
MEMORY67%
DISK I/O45%
NETWORK89%
SYSTEM MONITOR
|
SECURITY LOG
[14:23:45]INFOUser authentication successful
[14:23:47]WARNSuspicious network activity detected
[14:23:50]INFOFirewall rule updated
NETWORK SCAN
Scanning ports: 22, 80, 443, 3389
192.168.1.100 - OPEN
192.168.1.101 - FILTERED
Scan completed: 4/4 ports

Greedy vs Lazy Matching

Pattern Matching - Lesson 3

20 min
Progress0/5

Understanding Greedy Matching

Concept

By default, quantifiers are greedy - they match as much as possible while still allowing the overall pattern to succeed.

Example

.* in "hello world" matches the entire string
\d+ in "123abc456" matches "123" (first occurrence)

Practical Application

Greedy matching tries to consume maximum characters, which can lead to unexpected results