Note: If you try to access group 2 you will get an error: Inde圎rror: no such group in case of group(2)Ĭatch if the first group is the word - number and then return only the second group: ```pythonĬatch if the first group is not the word - test and then return only the second group: Note: If you give non existing group number like 3 you will get error: Inde圎rror: no such group in case of group(3) ![]() Below you can see how method group returns the group depending on their number: import re For examples when you search for dates, sentences groups are very useful. ![]() Groups can be used to separate your results.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |