Metadata extraction problem

Hi,

I have a problem with metadata extraction.
This is the name of my 2 files :

  • 1206_TR1_m1_c1.tif ( i have 3 more files named with c2, c3 and c4)
  • 1206_TR1_m2_c1.tif ( i have 3 more files named with c2, c3 and c4)

I used this regular expression :
^(?P.*)_TR(?P

[0-9])_m(?P[0-100])_c(?P[0-9])

For the first file is ok, CP recognizes very well the name file but not for the second one …

I joined a screenshot, if anyone has any idea, it will be very helpfull ! :slight_smile:

Many thanks,

Best,

Jessica

Hi Jessica,
The problem comes from your “(?P<TileNumber>[0-100])”
it’s not a “range” that should be here, but the kinds of characters.
One working solution would be “(?P<TileNumber>[0-9].*)”
Good luck,
Fabien

1 Like

Hi Fabien,

Many thanks ! It works ! :slight_smile:

I don’t understand between : “(?P[0-100])” and “(?P[0-9].*)”…

Thank you !

Jessica

P[0-100] would mean you’re expecting only a 0 or a 1 digit
P[0-9].*)_ means you’re expecting digits between 0 and 9, and as many until you encounter the _
ok?

Perfect ! It’s very clear :slight_smile:

Thanks !