I want to print elements of list via regex this is my code:
myresult_tv = [ 'Extinct A Horizon Guide to Dinosaurs WEB h264-WEBTUBE', 'High Noon 2019 04 05 720p HDTV DD5 1 MPEG2-NTb', 'Wyatt Cenacs Problem Areas S02E01 1080p WEBRip x264-eSc', 'Bondi Vet S05E15 720p WEB x264-GIMINI', 'If Loving You Is Wrong S04E03 Randals Stage HDTV x264-CRiMSON', 'Wyatt Cenacs Problem Areas S02E01 WEBRip x264-eSc', 'Bondi Vet S05E15 1080p WEB x264-GIMINI']
li = []
for a in myresult_tv:
w = re.match(".*\d ", a)
c =w.group()
li.append(c)
print(li)
and the result is :
Traceback (most recent call last):
File "azazzazazaaz.py", line 31, in <module>
c =w.group()
AttributeError: 'NoneType' object has no attribute 'group'
***Repl Closed***
if (w):before accessing.group()on match object. What are you trying to extract from the string?High Noon 2019 04 05but the first element make code rise error and i need to skip those element like first element make error