Omniferum Posted September 6, 2010 Report Share Posted September 6, 2010 I'm rather curious as to how we can replace something with the : symbol, I don't see a way of making it treat : as text and not as an operator. Only two of my links are given as %3A which is the : symbol, I want to replace %3A with : obviously. Also has %2F which is the / {download:multireplace:,:%2F,%3A:/,:} That works for the / but the %3A is just replaced with nothing so i'm not sure how to get it. Any pointers? Link to comment Share on other sites More sharing options...
Tomorrow Posted September 6, 2010 Report Share Posted September 6, 2010 Hmm intresting question.Still why would you want ":"? Is it for download link,appname or something else? Just a crazy but maybe try: {download:multireplace:,:%2F,%3A:/,":"} or {download:multireplace:,:%2F,%3A:/,::} Link to comment Share on other sites More sharing options...
Omniferum Posted September 7, 2010 Author Report Share Posted September 7, 2010 Were the first things I tried, didn't work. http%3A%2F%2Fdownload.portableapps.com%2Fportableapps%2Ffoxitreaderportable%2FFoxitReaderPortable_4.1.1.paf.exe That is what i'm trying to convert, as I said it is for a link. I can obviously just skip the http: part and put that in manually but I think it would be good for ketarin to be able to have an operator that says 'treat this as text' like the \ for regex Link to comment Share on other sites More sharing options...
shawn Posted September 7, 2010 Report Share Posted September 7, 2010 I've never been in that position, but as a rule, you use the backslash to "escape" characters. So something like this ought to work: {download:replace:%3A%2F%2F:\://} However, it would be so much easier to simply extract only that portion you needed in the first place, and prepend "http://" in the download box: (download\.portableapps\.com%2Fportableapps%2Ffoxitreaderportable%2FFoxitReaderPortable_[\d\.]+paf\.exe) Link to comment Share on other sites More sharing options...
Omniferum Posted September 7, 2010 Author Report Share Posted September 7, 2010 Ah, worked perfectly. I should remember that, backslash for most languages to escape special characters. Wasn't aware it was a common practice Link to comment Share on other sites More sharing options...
Omniferum Posted December 22, 2010 Author Report Share Posted December 22, 2010 Got another one that's bugging me, i'm just trying to get the appname to be returned without any illegal windows characters {appname:multireplace:,:/,?,<,>,\,/:,*,”:} Just make Ketarin crash, but I assume i'm close enough to being correct. Can anyone give me that final thing i'm obviously missing? Link to comment Share on other sites More sharing options...
shawn Posted December 22, 2010 Report Share Posted December 22, 2010 This should work for you: {appname:multireplace:,\:/,?,<,>,\,/:,*,”:} However, as a rule, whitelisting characters is far safer than blacklisting. Thus, this should be more reliable: {appname:regexreplace:([^a-zA-Z0-9\_]+):-} That'll replace any non-alphanumeric or underscore sequences with a single dash. So something like "Title | my trip to mars: fun times!" will become "Title-my-trip-to-mars-fun-times-" Link to comment Share on other sites More sharing options...
Omniferum Posted December 22, 2010 Author Report Share Posted December 22, 2010 Awesome, thanks shawn. Works like a charm 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