mikeparkie Posted March 11, 2013 Report Share Posted March 11, 2013 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 More sharing options...
shawn Posted March 12, 2013 Report Share Posted March 12, 2013 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 More sharing options...
shawn Posted March 12, 2013 Report Share Posted March 12, 2013 Oh, and the 'why' - regex is more for capture than clipping, and using the 'split' method as demonstrated above ensures that even once the release is in version 10+ it'll still continue to operate correctly. Link to comment Share on other sites More sharing options...
mikeparkie Posted March 12, 2013 Author Report Share Posted March 12, 2013 Thank you Shawn, worked a treat. Your help is always appreciated! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now