Jump to content
Ketarin forum

Little help with regex


mikeparkie
 Share

Recommended Posts

As I always seem to struggle with regex..

 

I need to a regex to remove a second period from a string e.g. 3.9.9 becomes 3.99

 

The download url is: http://www.getsharepod.com/download/SharePod_3.99.zip

 

But the version page http://www.getsharepod.com/download/ displays 3.9.9, so my download http://www.getsharepod.com/download/SharePod_3.9.9.zip fails.

 

Assistance appreciated.

Link to comment
Share on other sites

While you *could* use regex for this, it's really not the best method. This is how I would do it:

 

Set 'version' to the full version capture from http://www.getsharepod.com/download/changelog.aspx :

SharePod ([\d\.]+)\s\(

 

Then set the 'sdownload' url like this:

http://www.getsharepod.com/download/SharePod_{version:split:.:0}.{version:split:.:1}{version:split:.:2}.zip

 

Then put {sdownload} in the 'URL' box.

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.