
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Get the Number of Capture Groups in Python Regular Expression
The following code gets the number of captured groups using Python regex in given string
Example
import re m = re.match(r"(\d)(\d)(\d)", "632") print len(m.groups())
Output
This gives the output
3
Advertisements