Module 9: Advanced Core Features
Regular Expressions, Pattern & Matcher
Parse text with regex using the Pattern/Matcher APIs.
Compile regex patterns once (Pattern.compile) to avoid reparsing.
Use named groups ((?<area>\d{3})) and Matcher.group("area") for clarity.
Beware catastrophic backtracking—anchor patterns and keep quantifiers specific.