I need a regular expression i.e pat

i have to get the labels for the dataset i am trying to create but the pat that was used in the lecture is not working on my image path. i have tried many different pat but none of them is working so this is my PosixPath(’/content/drive/My Drive/sport/rugby_7.jpg’) path and i want a pat for the ImageDataBunch.from_name_re function, so that only rugby_7.jpg is extracted from it. thanks for the help

([^\/]*)\.*$ should do it

1 Like