Why does multiple sequence of wildcard characters not work in re.search?

  Kiến thức lập trình

I am trying to use re.search but with multiple wildcard characters and it does not work. Is there something else I have to do? Or is there a better method?

import re
pattern = '2A-CS-*.GPM.DPR.V*'
file = '/home/files/2A-CS-WFF.GPM.DPR.V9-20240130.20240707-S220512-E220609.058829.V07C.HDF5'
print(re.search(pattern, file)) #returns None

1

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT