Hi, I am looking for a regex which should find the last occurance of a expression like I have to find last PM(/d+)*.xml in a file t1.txt ggdt 2365 237 PM23jhfy&%_kkf.xml wknw f wef ^& 8* uy y w9 8y ivhodio wroio wroi icvo PM12_uryt&^%_uieg.xml uet.

But this is finding the first PM*.xml. I also tried .*PM(/d+)*.xml but getting the first one. Please help

So you just need the numbers from the last occurence of PM? Or the whole PM .. .xml line?

Quote

I have to find last PM(/d+)*.xml in a file

Seeing how you said find last occurrence in a file, I'm assuming these are lines in a file. So therefore here are a few examples, not clear exactly if you are just wanting the digits from the last occurrence or the whole line.