• Announcements

shawn

function: prepend

5 posts in this topic

Feature request for a function that only prepends the text if a certain condition is met.

 

For example, the parsed download for LicenseCrawler now includes the full domain. I imagine this will change shortly and return to just the relative path name. Instead of updating my app profile, I'd like to be able to prepend the protocol and domain name ONLY when a protocol and domain name aren't there.

 

In context I imagine it would go something like this, the logic being presented as, "if '//' isn't included in the variable value, prepend the value with x". Note that since multiple instances of ":" are expected (especially for prepended text) everything after the first separator should be ignored.

 

 

{download:prepend://:http://example.com}

Share this post


Link to post
Share on other sites

No. The regexreplace example you've provided would replace an instance of // with the protocol and domain if it appears at the beginning of a string (//path/file.ext), but it would not replace anything if the text "//" doesn't appear.

Share this post


Link to post
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