The document lists various questions related to Python regular expressions, covering topics such as the definition of regular expressions, functions like re.match() and re.search(), and the use of special characters. It also includes questions about validating email addresses, matching phone numbers, and extracting numbers from strings. Additionally, it addresses concepts like greedy vs non-greedy matching, character classes, and word boundaries.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
4 views1 page
Python Regex Questions List
The document lists various questions related to Python regular expressions, covering topics such as the definition of regular expressions, functions like re.match() and re.search(), and the use of special characters. It also includes questions about validating email addresses, matching phone numbers, and extracting numbers from strings. Additionally, it addresses concepts like greedy vs non-greedy matching, character classes, and word boundaries.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1
List of Python Regular Expression Questions
⭐ Q1. What is a Regular Expression in Python? Explain with examples.
⭐ Q2. Differentiate between re.match(), re.search(), and re.findall() in Python. Q3. Explain the use of special characters in regular expressions. ⭐ Q4. How can you validate an email address using regular expressions? Q5. What does the re.sub() function do? Give an example. Q6. How are character classes used in regex? Provide examples. ⭐ Q7. What is the purpose of grouping () in regular expressions? Q8. Explain greedy vs non-greedy matching in Python regex. ⭐ Q9. How do you match a phone number format using regex? Q10. How can you find all words starting with a capital letter in a string? ⭐ Q11. What is the use of ^ and $ in regular expressions? Q12. How do you escape special characters in regex patterns? ⭐ Q13. How do you extract all numbers from a given string using regex? Q14. What is the difference between re.split() and str.split()? ⭐ Q15. Explain the use of \b (word boundary) in regular expressions.