What is Regular Expression?
A regular expression (regex or regexp) is a sequence of characters that defines a search pattern. Used for string matching, validation, search-and-replace, and parsing. Common metacharacters: . (any), * (zero or more), + (one or more), ? (optional), [] (character class), () (group), | (alternation). Different flavors exist (JavaScript, PCRE, Python). Regex is powerful but can be complex and prone to edge cases. Use for validation, log parsing, text editors, and search tools.