1. What is Regex?
A regular expression (regex or regexp) is a sequence of characters that defines a search pattern. Think of it as a smart "find" tool — instead of searching for exact text, you search for patterns.
Regex is used everywhere in programming: - Validating input (emails, phone numbers, passwords) - Searching text (find all URLs in a document) - Extracting data (pull dates from a log file) - Find & replace (reformat text programmatically)