Fast review mode: answers are shown by default so you can skim quickly. Hide them if you want to self-test.
Regular expressions, often shortened to regex or regexp, are a sequence of characters that define a search pattern. They can be used to search, edit, or manipulate text. Python has a built-in package called re that supports regular expressions.
Here are some of the basic metacharacters used in RegEx: ^: Checks if the string starts with a particular word or character $: Checks if the string ends with a particular word or character |: Used to check either/or condition
Here are some examples of regular expressions: \d matches any single digit \w matches any alphanumeric character . matches any single character * matches zero or more occurrences of the preceding character + matches one or more occurrences of the preceding character ? matches zero or one occurrence of the preceding character
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.