I also have the same problem
I have been trying to extract “apples” and “tomatoes” with pat = r"/([^/]+)\d+.jpg$", but this doest seem to work. When I run the line data = ImageDataBunch.from_name_re(path_img, fnamess, pat,
size=224, bs=bs )
I get the error : "Failed to find "re.compile(’/([^/]+)\d+.jpg$’)" in “/content/data/apples_30.jpeg”
Can somebody please help me out to find RE that works for .jpg and .png as well.