Jump to content
Ketarin forum

Get n-th occurrence


timteka
 Share

Recommended Posts

Hi' date=' guys,

didn't find the answer on the forum. So the problem is: i have several files on the host of the same programme. How can i download the latest one? (not by date, but rather by occurrence)[/quote']

You can use the right to left check box when writing your regex.

 

And?

e.g.

<table>

<tr><td>myfile_1.0.1.zip<td></tr>

<tr><td>myfile_1.0.2.zip<td></tr>

<tr><td>myfile_1.4.3.zip<td></tr>

</table>

 

i use 'myfile_*.zip' as regexp string.

How can i grab the last line?

Link to comment
Share on other sites

use this regex:

myfile_(\d(?:\.\d+)+)\.zip

 

and chech the RTL check box

 

BTW, 'myfile_*.zip' won't work, in your example, it will match

<table>

<tr><td>myfile_1.0.1.zip<td></tr>

<tr><td>myfile_1.0.2.zip<td></tr>

<tr><td>myfile_1.4.3.zip<td></tr>

</table>

 

This could work

myfile_.*?.zip

Link to comment
Share on other sites

OMG! Andreone, thank you so much

I was trying with your exact example from the screenshot. Nothing helped. Then i removed and recreated the rule and....it helped finally! (was it a bug or smth? there wasn't even hilighting of the search terms before recreation of the rule)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.