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

Alternation and OR Logic

Pattern Matching - Lesson 4

14 min
Progress0/5

Introduction to Alternation

Concept

The pipe character | acts as OR logic in regex. It allows matching one pattern OR another pattern.

Example

cat|dog matches either "cat" or "dog"
red|blue|green matches any of the three colors

Practical Application

Use alternation when you have multiple valid options for a single position in your pattern