i have been trying to get the last 2 words from something like this http://www.website.com/pic.jpg used $gettok(1,4,47) and mixed the numbers around a lot. and sometimes it works, but if diff folders on the website sometimes i get com/pic.jpg is it $matchtok i need to do or what?
The reason this is failing is because you're searching for a forth instance (token) of 47 (/) which isnt found since http://www.website.com/pic.jpg only contains three / tokens. Which returns nothing or $null. Anyways here's an example:
Code:
alias getlocation {
if ($regex($1,^(http://|ftp://|https://)) && $count($1,/)) {
return $gettok($1,3-,47)
}
}